Most commonly only one firmware is used by the driver
and it is not needed to selected run time. So restore
old functionality but allow .get_firmware_name() callback
to override it.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
#define CYPRESS_FX2 3
int usb_ctrl;
+ int size_of_priv;
+
+ const char *firmware;
+ int (*get_firmware_name) (struct dvb_usb_device *, const char **);
#define RECONNECTS_USB 1
int (*download_firmware) (struct dvb_usb_device *,
const struct firmware *);
- int (*get_firmware_name) (struct dvb_usb_device *, const char **);
-
- int size_of_priv;
int num_adapters;
int (*get_adapter_count) (struct dvb_usb_device *);
const struct firmware *fw = NULL;
const char *name;
- ret = d->props.get_firmware_name(d, &name);
- if (ret < 0)
- return ret;
+ /* resolve firmware name */
+ name = d->props.firmware;
+ if (d->props.get_firmware_name) {
+ ret = d->props.get_firmware_name(d, &name);
+ if (ret < 0)
+ return ret;
+ }
ret = request_firmware(&fw, name, &d->udev->dev);
if (ret != 0) {