diff options
author | Patrick Boettcher <devnull@localhost> | 2005-01-07 11:49:57 +0000 |
---|---|---|
committer | Patrick Boettcher <devnull@localhost> | 2005-01-07 11:49:57 +0000 |
commit | 9e82b4398f27a1204dd4d936bc80cd5aeff7c909 (patch) | |
tree | 0162be8d0184bf98ca527785846e3885f49d2218 /linux/drivers/media/dvb/dibusb/dvb-dibusb-firmware.c | |
parent | 56d193de59c49154de25605be5d16575d31db04e (diff) | |
download | mediapointer-dvb-s2-9e82b4398f27a1204dd4d936bc80cd5aeff7c909.tar.gz mediapointer-dvb-s2-9e82b4398f27a1204dd4d936bc80cd5aeff7c909.tar.bz2 |
dibusb internal refactoring step 2/3
Diffstat (limited to 'linux/drivers/media/dvb/dibusb/dvb-dibusb-firmware.c')
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb-firmware.c | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-firmware.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-firmware.c index a6585e87e..972548a0c 100644 --- a/linux/drivers/media/dvb/dibusb/dvb-dibusb-firmware.c +++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb-firmware.c @@ -22,30 +22,20 @@ static int dibusb_writemem(struct usb_device *udev,u16 addr,u8 *data, u8 len) 0xa0, USB_TYPE_VENDOR, addr, 0x00, data, len, 5*HZ); } -int dibusb_loadfirmware(struct usb_device *udev, struct dibusb_device *dibdev) +int dibusb_loadfirmware(struct usb_device *udev, struct dibusb_usb_device *dibdev) { const struct firmware *fw = NULL; - const char **fws; u16 addr; u8 *b,*p; int ret = 0,i; - fws = dibdev->parm->fw_filenames; - - for (i = 0; i < sizeof(fws)/sizeof(const char*); i++) { - if ((ret = request_firmware(&fw, fws[i], &udev->dev)) == 0) { - info("using firmware file (%s).",fws[i]); - break; - } - deb_info("tried to find '%s' firmware - unsuccessful. (%d)\n", - fws[i],ret); + if ((ret = request_firmware(&fw, dibdev->dev_cl->firmware, &udev->dev)) != 0) { + err("did not find a valid firmware file. (%s) " + "Please see linux/Documentation/dvb/ for more details on firmware-problems.", + dibdev->dev_cl->firmware); + return ret; } - - if (fw == NULL) { - err("did not find a valid firmware file. " - "Please see linux/Documentation/dvb/ for more details on firmware-problems."); - return -EINVAL; - } + p = kmalloc(fw->size,GFP_KERNEL); if (p != NULL) { u8 reset; @@ -58,7 +48,7 @@ int dibusb_loadfirmware(struct usb_device *udev, struct dibusb_device *dibdev) /* stop the CPU */ reset = 1; - if ((ret = dibusb_writemem(udev,dibdev->parm->usb_cpu_csreg,&reset,1)) != 1) + if ((ret = dibusb_writemem(udev,dibdev->dev_cl->usb_ctrl->cpu_cs_register,&reset,1)) != 1) err("could not stop the USB controller CPU."); for(i = 0; p[i+3] == 0 && i < fw->size; ) { b = (u8 *) &p[i]; @@ -80,7 +70,7 @@ int dibusb_loadfirmware(struct usb_device *udev, struct dibusb_device *dibdev) ret = 0; /* restart the CPU */ reset = 0; - if (ret || dibusb_writemem(udev,dibdev->parm->usb_cpu_csreg,&reset,1) != 1) { + if (ret || dibusb_writemem(udev,dibdev->dev_cl->usb_ctrl->cpu_cs_register,&reset,1) != 1) { err("could not restart the USB controller CPU."); ret = -EINVAL; } |