From: Antti Palosaari Date: Thu, 24 May 2012 12:31:45 +0000 (-0300) Subject: [media] dvb_usb_v2: implement .get_firmware_name() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8b9dff5828cc91abddf8f4a44c8a38b1012052af;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git [media] dvb_usb_v2: implement .get_firmware_name() Use callback to return firmware name instead of static firmware name. There is some chips that needs to select firmware name according to chip revision. Signed-off-by: Antti Palosaari Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb/dvb-usb/dvb_usb.h b/drivers/media/dvb/dvb-usb/dvb_usb.h index e3d55525dec5..c538e113bd58 100644 --- a/drivers/media/dvb/dvb-usb/dvb_usb.h +++ b/drivers/media/dvb/dvb-usb/dvb_usb.h @@ -278,7 +278,7 @@ struct dvb_usb_device_properties { #define RECONNECTS_USB 1 int (*download_firmware) (struct dvb_usb_device *, const struct firmware *); - const char *firmware; + int (*get_firmware_name) (struct dvb_usb_device *, const char **); int size_of_priv; diff --git a/drivers/media/dvb/dvb-usb/dvb_usb_firmware.c b/drivers/media/dvb/dvb-usb/dvb_usb_firmware.c index dd9f8220adea..b9b169c8f0da 100644 --- a/drivers/media/dvb/dvb-usb/dvb_usb_firmware.c +++ b/drivers/media/dvb/dvb-usb/dvb_usb_firmware.c @@ -79,15 +79,20 @@ int dvb_usb_download_firmware(struct dvb_usb_device *d) { int ret; const struct firmware *fw = NULL; + const char *name; - if ((ret = request_firmware(&fw, d->props.firmware, &d->udev->dev)) != 0) { + ret = d->props.get_firmware_name(d, &name); + if (ret < 0) + return ret; + + if ((ret = request_firmware(&fw, name, &d->udev->dev)) != 0) { err("did not find the firmware file. (%s) " "Please see linux/Documentation/dvb/ for more details on firmware-problems. (%d)", - d->props.firmware,ret); + name,ret); return ret; } - info("downloading firmware from file '%s'", d->props.firmware); + info("downloading firmware from file '%s'", name); switch (d->props.usb_ctrl) { case CYPRESS_AN2135: