From 005bc3fce76b3bd7c0a583cf3e89ce11c87077cd Mon Sep 17 00:00:00 2001 From: Antti Palosaari Date: Fri, 25 May 2012 12:28:43 -0300 Subject: [PATCH] [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: Antti Palosaari Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-usb/dvb_usb.h | 7 ++++--- drivers/media/dvb/dvb-usb/dvb_usb_firmware.c | 10 +++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/media/dvb/dvb-usb/dvb_usb.h b/drivers/media/dvb/dvb-usb/dvb_usb.h index 974337ddc5c4..716f17455669 100644 --- a/drivers/media/dvb/dvb-usb/dvb_usb.h +++ b/drivers/media/dvb/dvb-usb/dvb_usb.h @@ -219,12 +219,13 @@ struct dvb_usb_device_properties { #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 *); diff --git a/drivers/media/dvb/dvb-usb/dvb_usb_firmware.c b/drivers/media/dvb/dvb-usb/dvb_usb_firmware.c index 62bd865a6462..e0b43139c0c4 100644 --- a/drivers/media/dvb/dvb-usb/dvb_usb_firmware.c +++ b/drivers/media/dvb/dvb-usb/dvb_usb_firmware.c @@ -96,9 +96,13 @@ int dvb_usb_download_firmware(struct dvb_usb_device *d) 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) { -- 2.34.1