Commit 005bc3fc authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[media] dvb_usb_v2: restore .firmware - pointer to name

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: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 64921670
...@@ -219,12 +219,13 @@ struct dvb_usb_device_properties { ...@@ -219,12 +219,13 @@ struct dvb_usb_device_properties {
#define CYPRESS_FX2 3 #define CYPRESS_FX2 3
int usb_ctrl; int usb_ctrl;
int size_of_priv;
const char *firmware;
int (*get_firmware_name) (struct dvb_usb_device *, const char **);
#define RECONNECTS_USB 1 #define RECONNECTS_USB 1
int (*download_firmware) (struct dvb_usb_device *, int (*download_firmware) (struct dvb_usb_device *,
const struct firmware *); const struct firmware *);
int (*get_firmware_name) (struct dvb_usb_device *, const char **);
int size_of_priv;
int num_adapters; int num_adapters;
int (*get_adapter_count) (struct dvb_usb_device *); int (*get_adapter_count) (struct dvb_usb_device *);
......
...@@ -96,9 +96,13 @@ int dvb_usb_download_firmware(struct dvb_usb_device *d) ...@@ -96,9 +96,13 @@ int dvb_usb_download_firmware(struct dvb_usb_device *d)
const struct firmware *fw = NULL; const struct firmware *fw = NULL;
const char *name; const char *name;
/* resolve firmware name */
name = d->props.firmware;
if (d->props.get_firmware_name) {
ret = d->props.get_firmware_name(d, &name); ret = d->props.get_firmware_name(d, &name);
if (ret < 0) if (ret < 0)
return ret; return ret;
}
ret = request_firmware(&fw, name, &d->udev->dev); ret = request_firmware(&fw, name, &d->udev->dev);
if (ret != 0) { if (ret != 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment