[PATCH 0/2] Use gpio_is_valid()
Replace the manual validity checks for the GPIO with the gpio_is_valid(). Arvind Yadav (2): [PATCH 1/2] [media] platform: Use gpio_is_valid() [PATCH 2/2] [media] sta2x11: Use gpio_is_valid() and remove unnecessary check drivers/media/pci/sta2x11/sta2x11_vip.c | 31 +++ drivers/media/platform/via-camera.c | 2 +- 2 files changed, 16 insertions(+), 17 deletions(-) -- 1.9.1
[PATCH 2/2] [media] sta2x11: Use gpio_is_valid() and remove unnecessary check
Replace the manual validity checks for the GPIO with the gpio_is_valid(). In vip_gpio_reserve(), Error checking for gpio pin is not correct. If pwr_pin = -1, It will return 0. This should be return an error. In sta2x11_vip_init_one(), Error checking for gpio 'reset_pin' is unnecessary. Because vip_gpio_reserve() is also checking for valid gpio pin. So removed extra error checking for gpio 'reset_pin'. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/sta2x11/sta2x11_vip.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/drivers/media/pci/sta2x11/sta2x11_vip.c b/drivers/media/pci/sta2x11/sta2x11_vip.c index dd199bf..069c4a8 100644 --- a/drivers/media/pci/sta2x11/sta2x11_vip.c +++ b/drivers/media/pci/sta2x11/sta2x11_vip.c @@ -908,10 +908,10 @@ static int sta2x11_vip_init_controls(struct sta2x11_vip *vip) static int vip_gpio_reserve(struct device *dev, int pin, int dir, const char *name) { - int ret; + int ret = -ENODEV; - if (pin == -1) - return 0; + if (!gpio_is_valid(pin)) + return ret; ret = gpio_request(pin, name); if (ret) { @@ -946,7 +946,7 @@ static int vip_gpio_reserve(struct device *dev, int pin, int dir, */ static void vip_gpio_release(struct device *dev, int pin, const char *name) { - if (pin != -1) { + if (gpio_is_valid(pin)) { dev_dbg(dev, "releasing pin %d (%s)\n", pin, name); gpio_unexport(pin); gpio_free(pin); @@ -1003,25 +1003,24 @@ static int sta2x11_vip_init_one(struct pci_dev *pdev, if (ret) goto disable; - if (config->reset_pin >= 0) { - ret = vip_gpio_reserve(>dev, config->reset_pin, 0, - config->reset_name); - if (ret) { - vip_gpio_release(>dev, config->pwr_pin, -config->pwr_name); - goto disable; - } + ret = vip_gpio_reserve(>dev, config->reset_pin, 0, + config->reset_name); + if (ret) { + vip_gpio_release(>dev, config->pwr_pin, +config->pwr_name); + goto disable; } - if (config->pwr_pin != -1) { + + if (gpio_is_valid(config->pwr_pin)) { /* Datasheet says 5ms between PWR and RST */ usleep_range(5000, 25000); - ret = gpio_direction_output(config->pwr_pin, 1); + gpio_direction_output(config->pwr_pin, 1); } - if (config->reset_pin != -1) { + if (gpio_is_valid(config->reset_pin)) { /* Datasheet says 5ms between PWR and RST */ usleep_range(5000, 25000); - ret = gpio_direction_output(config->reset_pin, 1); + gpio_direction_output(config->reset_pin, 1); } usleep_range(5000, 25000); -- 1.9.1
[PATCH 1/2] [media] platform: Use gpio_is_valid()
Replace the manual validity checks for the GPIO with the gpio_is_valid(). Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/platform/via-camera.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/via-camera.c b/drivers/media/platform/via-camera.c index e9a0263..f01c3e8 100644 --- a/drivers/media/platform/via-camera.c +++ b/drivers/media/platform/via-camera.c @@ -178,7 +178,7 @@ static int via_sensor_power_setup(struct via_camera *cam) cam->power_gpio = viafb_gpio_lookup("VGPIO3"); cam->reset_gpio = viafb_gpio_lookup("VGPIO2"); - if (cam->power_gpio < 0 || cam->reset_gpio < 0) { + if (!gpio_is_valid(cam->power_gpio) || !gpio_is_valid(cam->reset_gpio)) { dev_err(>platdev->dev, "Unable to find GPIO lines\n"); return -EINVAL; } -- 1.9.1
[RFT] media: hdpvr: Fix Double kfree() error
Here, double-free is happening on error path of hdpvr_probe. error_v4l2_unregister: v4l2_device_unregister(>v4l2_dev); => v4l2_device_disconnect => put_device => kobject_put => kref_put => v4l2_device_release => hdpvr_device_release (CALLBACK) => kfree(dev) error_free_dev: kfree(dev) Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- reported by: Dan Carpenter<dan.carpen...@oracle.com> drivers/media/usb/hdpvr/hdpvr-core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/usb/hdpvr/hdpvr-core.c b/drivers/media/usb/hdpvr/hdpvr-core.c index 29ac7fc..cab100a0 100644 --- a/drivers/media/usb/hdpvr/hdpvr-core.c +++ b/drivers/media/usb/hdpvr/hdpvr-core.c @@ -395,6 +395,7 @@ static int hdpvr_probe(struct usb_interface *interface, kfree(dev->usbc_buf); error_v4l2_unregister: v4l2_device_unregister(>v4l2_dev); + dev = NULL; error_free_dev: kfree(dev); error: -- 1.9.1
[PATCH] [media] winbond-cir: Fix pnp_irq's error checking for wbcir_probe
The pnp_irq() function returns -1 if an error occurs. pnp_irq() error checking for zero is not correct. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/rc/winbond-cir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c index 3ca7ab4..0adf099 100644 --- a/drivers/media/rc/winbond-cir.c +++ b/drivers/media/rc/winbond-cir.c @@ -1044,7 +1044,7 @@ struct wbcir_data { data->irq = pnp_irq(device, 0); if (data->wbase == 0 || data->ebase == 0 || - data->sbase == 0 || data->irq == 0) { + data->sbase == 0 || data->irq == -1) { err = -ENODEV; dev_err(dev, "Invalid resources\n"); goto exit_free_data; -- 1.9.1
[RFT] [media] em28xx: Fix use-after-free in v4l2_fh_init
Here, em28xx_free_v4l2 is release "v4l2->dev->v4l2" Which is allready release by em28xx_v4l2_init. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- This bug report by Andrey Konovalov "net/media/em28xx: use-after-free in v4l2_fh_init" drivers/media/usb/em28xx/em28xx-video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index 8d253a5..f1ee53f 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c @@ -2785,8 +2785,8 @@ static int em28xx_v4l2_init(struct em28xx *dev) v4l2_ctrl_handler_free(>ctrl_handler); v4l2_device_unregister(>v4l2_dev); err: - dev->v4l2 = NULL; kref_put(>ref, em28xx_free_v4l2); + dev->v4l2 = NULL; mutex_unlock(>lock); return ret; } -- 1.9.1
[RFT] media: dvb_frontend: Fix use-after-free in __dvb_frontend_free
Here, dvb_free_device will free dvb_device. dvb_frontend_invoke_release is using dvb_device after free. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- This bug report by Andrey Konovalov (usb/media/dtt200u: use-after-free in __dvb_frontend_free). drivers/media/dvb-core/dvb_frontend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c index 2fcba16..7f1ef12 100644 --- a/drivers/media/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb-core/dvb_frontend.c @@ -147,10 +147,10 @@ static void dvb_frontend_free(struct kref *ref) container_of(ref, struct dvb_frontend, refcount); struct dvb_frontend_private *fepriv = fe->frontend_priv; - dvb_free_device(fepriv->dvbdev); - dvb_frontend_invoke_release(fe, fe->ops.release); + dvb_free_device(fepriv->dvbdev); + kfree(fepriv); } -- 1.9.1
[PATCH] media: imon: Fix null-ptr-deref in imon_probe
It seems that the return value of usb_ifnum_to_if() can be NULL and needs to be checked. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- This bug report by Andrey Konovalov usb/media/imon: null-ptr-deref in imon_probe drivers/media/rc/imon.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index 7b3f31c..0c46155 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c @@ -2517,6 +2517,11 @@ static int imon_probe(struct usb_interface *interface, mutex_lock(_lock); first_if = usb_ifnum_to_if(usbdev, 0); + if (!first_if) { + ret = -ENODEV; + goto fail; + } + first_if_ctx = usb_get_intfdata(first_if); if (ifnum == 0) { -- 2.7.4
[PATCH 0/4] staging: rtlwifi: pr_err() strings should end with newlines
pr_err() messages should end with a new-line to avoid other messages being concatenated. Arvind Yadav (4): [PATCH 1/4] staging: gs_fpgaboot: pr_err() strings should end with newlines [PATCH 2/4] staging: media: davinci_vpfe: pr_err() strings should end with newlines [PATCH 3/4] staging: bcm2835-camera: pr_err() strings should end with newlines [PATCH 4/4] staging: rtlwifi: pr_err() strings should end with newlines drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 2 +- drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c | 2 +- drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c | 6 +++--- drivers/staging/rtlwifi/rtl8822be/phy.c | 4 ++-- drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) -- 1.9.1
[PATCH 4/4] staging: rtlwifi: pr_err() strings should end with newlines
pr_err() messages should end with a new-line to avoid other messages being concatenated. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c | 6 +++--- drivers/staging/rtlwifi/rtl8822be/phy.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c b/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c index f33024e..eeef8b6 100644 --- a/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c +++ b/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c @@ -1036,7 +1036,7 @@ enum halmac_ret_status if (halmac_send_fwpkt_88xx( halmac_adapter, code_ptr + mem_offset, send_pkt_size) != HALMAC_RET_SUCCESS) { - pr_err("halmac_send_fwpkt_88xx fail!!"); + pr_err("halmac_send_fwpkt_88xx fail!!\n"); return HALMAC_RET_DLFW_FAIL; } @@ -1046,7 +1046,7 @@ enum halmac_ret_status halmac_adapter->hw_config_info.txdesc_size, dest + mem_offset, send_pkt_size, first_part) != HALMAC_RET_SUCCESS) { - pr_err("halmac_iddma_dlfw_88xx fail!!"); + pr_err("halmac_iddma_dlfw_88xx fail!!\n"); return HALMAC_RET_DLFW_FAIL; } @@ -1057,7 +1057,7 @@ enum halmac_ret_status if (halmac_check_fw_chksum_88xx(halmac_adapter, dest) != HALMAC_RET_SUCCESS) { - pr_err("halmac_check_fw_chksum_88xx fail!!"); + pr_err("halmac_check_fw_chksum_88xx fail!!\n"); return HALMAC_RET_DLFW_FAIL; } diff --git a/drivers/staging/rtlwifi/rtl8822be/phy.c b/drivers/staging/rtlwifi/rtl8822be/phy.c index 4cba2ad..921226b 100644 --- a/drivers/staging/rtlwifi/rtl8822be/phy.c +++ b/drivers/staging/rtlwifi/rtl8822be/phy.c @@ -890,7 +890,7 @@ bool rtl8822be_load_txpower_by_rate(struct ieee80211_hw *hw) rtstatus = rtlpriv->phydm.ops->phydm_load_txpower_by_rate(rtlpriv); if (!rtstatus) { - pr_err("BB_PG Reg Fail!!"); + pr_err("BB_PG Reg Fail!!\n"); return false; } @@ -915,7 +915,7 @@ bool rtl8822be_load_txpower_limit(struct ieee80211_hw *hw) rtstatus = rtlpriv->phydm.ops->phydm_load_txpower_limit(rtlpriv); if (!rtstatus) { - pr_err("RF TxPwr Limit Fail!!"); + pr_err("RF TxPwr Limit Fail!!\n"); return false; } -- 1.9.1
[PATCH 3/4] staging: bcm2835-camera: pr_err() strings should end with newlines
pr_err() messages should end with a new-line to avoid other messages being concatenated. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c index 4360db6..6ea7fb0 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c @@ -1963,7 +1963,7 @@ int vchiq_mmal_finalise(struct vchiq_mmal_instance *instance) status = vchi_service_close(instance->handle); if (status != 0) - pr_err("mmal-vchiq: VCHIQ close failed"); + pr_err("mmal-vchiq: VCHIQ close failed\n"); mutex_unlock(>vchiq_mutex); -- 1.9.1
[PATCH 1/4] staging: gs_fpgaboot: pr_err() strings should end with newlines
pr_err() messages should end with a new-line to avoid other messages being concatenated. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c index bcbdc73..fa8b27e 100644 --- a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c +++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c @@ -106,7 +106,7 @@ static int readmagic_bitstream(u8 *bitdata, int *offset) read_bitstream(bitdata, buf, offset, 13); r = memcmp(buf, bits_magic, 13); if (r) { - pr_err("error: corrupted header"); + pr_err("error: corrupted header\n"); return -EINVAL; } pr_info("bitstream file magic number Ok\n"); -- 1.9.1
[PATCH 2/4] staging: media: davinci_vpfe: pr_err() strings should end with newlines
pr_err() messages should end with a new-line to avoid other messages being concatenated. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c index a893072..8cfe873 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c +++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c @@ -268,7 +268,7 @@ int config_ipipe_hw(struct vpfe_ipipe_device *ipipe) ipipe_mode = get_ipipe_mode(ipipe); if (ipipe_mode < 0) { - pr_err("Failed to get ipipe mode"); + pr_err("Failed to get ipipe mode\n"); return -EINVAL; } regw_ip(ipipe_base, ipipe_mode, IPIPE_SRC_MODE); -- 1.9.1
[RFT v2] [media] siano: FIX use-after-free in worker_thread
Call flush_work() on failure and disconnect. Work initialize and schedule in smsusb_onresponse(). it should be freed in smsusb_stop_streaming(). Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- This bug report by Andrey Konovalov "usb/media/smsusb: use-after-free in worker_thread". changes in v2 : call flush_work() in smsusb_stop_streaming(). drivers/media/usb/siano/smsusb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c index 8c1f926..8142ba4 100644 --- a/drivers/media/usb/siano/smsusb.c +++ b/drivers/media/usb/siano/smsusb.c @@ -192,6 +192,8 @@ static void smsusb_stop_streaming(struct smsusb_device_t *dev) for (i = 0; i < MAX_URBS; i++) { usb_kill_urb(>surbs[i].urb); + flush_work(>surbs[i].wq); + if (dev->surbs[i].cb) { smscore_putbuffer(dev->coredev, dev->surbs[i].cb); dev->surbs[i].cb = NULL; -- 2.7.4
[RFT] [media] siano: FIX use-after-free in worker_thread
If CONFIG_MEDIA_CONTROLLER_DVB is enable, We are not releasing media device and memory on any failure or disconnect a device. Adding structure media_device 'mdev' as part of 'smsusb_device_t' structure to make proper handle for media device. Now releasing a media device and memory on failure. It's allocate first in siano_media_device_register() and it should be freed last in smsusb_disconnect(). Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- This bug report by Andrey Konovalov "usb/media/smsusb: use-after-free in worker_thread". drivers/media/usb/siano/smsusb.c | 45 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c index 8c1f926..66936b3 100644 --- a/drivers/media/usb/siano/smsusb.c +++ b/drivers/media/usb/siano/smsusb.c @@ -69,6 +69,9 @@ struct smsusb_device_t { unsigned char in_ep; unsigned char out_ep; enum smsusb_state state; +#ifdef CONFIG_MEDIA_CONTROLLER_DVB + struct media_device *mdev; +#endif }; static int smsusb_submit_urb(struct smsusb_device_t *dev, @@ -359,6 +362,13 @@ static void smsusb_term_device(struct usb_interface *intf) if (dev->coredev) smscore_unregister_device(dev->coredev); +#ifdef CONFIG_MEDIA_CONTROLLER_DVB + if (dev->mdev) { + media_device_unregister(dev->mdev); + media_device_cleanup(dev->mdev); + kfree(dev->mdev); + } +#endif pr_debug("device 0x%p destroyed\n", dev); kfree(dev); } @@ -370,27 +380,28 @@ static void *siano_media_device_register(struct smsusb_device_t *dev, int board_id) { #ifdef CONFIG_MEDIA_CONTROLLER_DVB - struct media_device *mdev; struct usb_device *udev = dev->udev; struct sms_board *board = sms_get_board(board_id); int ret; - mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); - if (!mdev) + dev->mdev = kzalloc(sizeof(*dev->mdev), GFP_KERNEL); + if (!dev->mdev) return NULL; - media_device_usb_init(mdev, udev, board->name); - ret = media_device_register(mdev); + media_device_usb_init(dev->mdev, udev, board->name); + + ret = media_device_register(dev->mdev); if (ret) { - media_device_cleanup(mdev); - kfree(mdev); + media_device_cleanup(dev->mdev); + kfree(dev->mdev); + dev->mdev = NULL; return NULL; } pr_info("media controller created\n"); - return mdev; + return dev->mdev; #else return NULL; #endif @@ -458,12 +469,7 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id) rc = smscore_register_device(, >coredev, mdev); if (rc < 0) { pr_err("smscore_register_device(...) failed, rc %d\n", rc); - smsusb_term_device(intf); -#ifdef CONFIG_MEDIA_CONTROLLER_DVB - media_device_unregister(mdev); -#endif - kfree(mdev); - return rc; + goto err_smsusb_init; } smscore_set_board_id(dev->coredev, board_id); @@ -480,8 +486,7 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id) rc = smsusb_start_streaming(dev); if (rc < 0) { pr_err("smsusb_start_streaming(...) failed\n"); - smsusb_term_device(intf); - return rc; + goto err_smsusb_init; } dev->state = SMSUSB_ACTIVE; @@ -489,13 +494,17 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id) rc = smscore_start_device(dev->coredev); if (rc < 0) { pr_err("smscore_start_device(...) failed\n"); - smsusb_term_device(intf); - return rc; + goto err_smsusb_init; } pr_debug("device 0x%p created\n", dev); return rc; + +err_smsusb_init: + smsusb_term_device(intf); + + return rc; } static int smsusb_probe(struct usb_interface *intf, -- 1.9.1
Re: usb/media/hdpvr: trying to register non-static key in hdpvr_probe
Hi Andrey, On Friday 22 September 2017 05:16 PM, Andrey Konovalov wrote: On Fri, Sep 22, 2017 at 9:41 AM, Arvind Yadav <arvind.yadav...@gmail.com> wrote: Hi, I have a doubt. Why we are calling flush_work in hdpvr_probe for every failure. We are flushing work which is not defined yet. Here, hdpvr_register_videodev() is responsible for setup and register a video device. Also defining and initializing a worker. we are calling hdpvr_register_videodev() at last. No need to flash any work here. Please correct me, if I am wrong. Hi Arvind, I believe you're right, no need to call flush_work() before dev->worker is initialized. Could you send a fix? I'm able to reproduce the issue, so I can test your patches if needed. I have send a one patch to you. which will resolve this error. But my question is why hdpvr_probe() is failing. We need to find out. Could please share more information and logs. ~arvind Thanks! On Thursday 21 September 2017 09:09 PM, Andrey Konovalov wrote: Hi! I've got the following report while fuzzing the kernel with syzkaller. On commit ebb2c2437d8008d46796902ff390653822af6cc4 (Sep 18). INFO: trying to register non-static key. the code is fine but needs lockdep annotation. turning off the locking correctness validator. CPU: 0 PID: 24 Comm: kworker/0:1 Not tainted 4.14.0-rc1-42251-gebb2c2437d80 #215 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 Workqueue: usb_hub_wq hub_event Call Trace: __dump_stack lib/dump_stack.c:16 dump_stack+0x292/0x395 lib/dump_stack.c:52 register_lock_class+0x6c4/0x1a00 kernel/locking/lockdep.c:769 __lock_acquire+0x27e/0x4550 kernel/locking/lockdep.c:3385 lock_acquire+0x259/0x620 kernel/locking/lockdep.c:4002 flush_work+0xf0/0x8c0 kernel/workqueue.c:2886 hdpvr_probe+0x233/0x20d0 drivers/media/usb/hdpvr/hdpvr-core.c:400 usb_probe_interface+0x35d/0x8e0 drivers/usb/core/driver.c:361 really_probe drivers/base/dd.c:413 driver_probe_device+0x610/0xa00 drivers/base/dd.c:557 __device_attach_driver+0x230/0x290 drivers/base/dd.c:653 bus_for_each_drv+0x161/0x210 drivers/base/bus.c:463 __device_attach+0x26e/0x3d0 drivers/base/dd.c:710 device_initial_probe+0x1f/0x30 drivers/base/dd.c:757 bus_probe_device+0x1eb/0x290 drivers/base/bus.c:523 device_add+0xd0b/0x1660 drivers/base/core.c:1835 usb_set_configuration+0x104e/0x1870 drivers/usb/core/message.c:1932 generic_probe+0x73/0xe0 drivers/usb/core/generic.c:174 usb_probe_device+0xaf/0xe0 drivers/usb/core/driver.c:266 really_probe drivers/base/dd.c:413 driver_probe_device+0x610/0xa00 drivers/base/dd.c:557 __device_attach_driver+0x230/0x290 drivers/base/dd.c:653 bus_for_each_drv+0x161/0x210 drivers/base/bus.c:463 __device_attach+0x26e/0x3d0 drivers/base/dd.c:710 device_initial_probe+0x1f/0x30 drivers/base/dd.c:757 bus_probe_device+0x1eb/0x290 drivers/base/bus.c:523 device_add+0xd0b/0x1660 drivers/base/core.c:1835 usb_new_device+0x7b8/0x1020 drivers/usb/core/hub.c:2457 hub_port_connect drivers/usb/core/hub.c:4903 hub_port_connect_change drivers/usb/core/hub.c:5009 port_event drivers/usb/core/hub.c:5115 hub_event+0x194d/0x3740 drivers/usb/core/hub.c:5195 process_one_work+0xc7f/0x1db0 kernel/workqueue.c:2119 worker_thread+0x221/0x1850 kernel/workqueue.c:2253 kthread+0x3a1/0x470 kernel/kthread.c:231 ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431 hdpvr: probe of 1-1:8.217 failed with error -12 ~arvind
[PATCH] [media] hdpvr: Fix an error handling path in hdpvr_probe()
Here, hdpvr_register_videodev() is responsible for setup and register a video device. Also defining and initializing a worker. hdpvr_register_videodev() is calling by hdpvr_probe at last. So No need to flash any work here. Unregister v4l2, free buffers and memory. If hdpvr_probe() will fail. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/usb/hdpvr/hdpvr-core.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/media/usb/hdpvr/hdpvr-core.c b/drivers/media/usb/hdpvr/hdpvr-core.c index dbe29c6..1e8cbaf 100644 --- a/drivers/media/usb/hdpvr/hdpvr-core.c +++ b/drivers/media/usb/hdpvr/hdpvr-core.c @@ -292,7 +292,7 @@ static int hdpvr_probe(struct usb_interface *interface, /* register v4l2_device early so it can be used for printks */ if (v4l2_device_register(>dev, >v4l2_dev)) { dev_err(>dev, "v4l2_device_register failed\n"); - goto error; + goto error_free_dev; } mutex_init(>io_mutex); @@ -301,7 +301,7 @@ static int hdpvr_probe(struct usb_interface *interface, dev->usbc_buf = kmalloc(64, GFP_KERNEL); if (!dev->usbc_buf) { v4l2_err(>v4l2_dev, "Out of memory\n"); - goto error; + goto error_v4l2_unregister; } init_waitqueue_head(>wait_buffer); @@ -339,13 +339,13 @@ static int hdpvr_probe(struct usb_interface *interface, } if (!dev->bulk_in_endpointAddr) { v4l2_err(>v4l2_dev, "Could not find bulk-in endpoint\n"); - goto error; + goto error_put_usb; } /* init the device */ if (hdpvr_device_init(dev)) { v4l2_err(>v4l2_dev, "device init failed\n"); - goto error; + goto error_put_usb; } mutex_lock(>io_mutex); @@ -353,7 +353,7 @@ static int hdpvr_probe(struct usb_interface *interface, mutex_unlock(>io_mutex); v4l2_err(>v4l2_dev, "allocating transfer buffers failed\n"); - goto error; + goto error_put_usb; } mutex_unlock(>io_mutex); @@ -361,7 +361,7 @@ static int hdpvr_probe(struct usb_interface *interface, retval = hdpvr_register_i2c_adapter(dev); if (retval < 0) { v4l2_err(>v4l2_dev, "i2c adapter register failed\n"); - goto error; + goto error_free_buffers; } client = hdpvr_register_ir_rx_i2c(dev); @@ -394,13 +394,17 @@ static int hdpvr_probe(struct usb_interface *interface, reg_fail: #if IS_ENABLED(CONFIG_I2C) i2c_del_adapter(>i2c_adapter); +error_free_buffers: #endif + hdpvr_free_buffers(dev); +error_put_usb: + usb_put_dev(dev->udev); + kfree(dev->usbc_buf); +error_v4l2_unregister: + v4l2_device_unregister(>v4l2_dev); +error_free_dev: + kfree(dev); error: - if (dev) { - flush_work(>worker); - /* this frees allocated memory */ - hdpvr_delete(dev); - } return retval; } -- 1.9.1
Re: usb/media/hdpvr: trying to register non-static key in hdpvr_probe
Hi, I have a doubt. Why we are calling flush_work in hdpvr_probe for every failure. We are flushing work which is not defined yet. Here, hdpvr_register_videodev() is responsible for setup and register a video device. Also defining and initializing a worker. we are calling hdpvr_register_videodev() at last. No need to flash any work here. Please correct me, if I am wrong. On Thursday 21 September 2017 09:09 PM, Andrey Konovalov wrote: Hi! I've got the following report while fuzzing the kernel with syzkaller. On commit ebb2c2437d8008d46796902ff390653822af6cc4 (Sep 18). INFO: trying to register non-static key. the code is fine but needs lockdep annotation. turning off the locking correctness validator. CPU: 0 PID: 24 Comm: kworker/0:1 Not tainted 4.14.0-rc1-42251-gebb2c2437d80 #215 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 Workqueue: usb_hub_wq hub_event Call Trace: __dump_stack lib/dump_stack.c:16 dump_stack+0x292/0x395 lib/dump_stack.c:52 register_lock_class+0x6c4/0x1a00 kernel/locking/lockdep.c:769 __lock_acquire+0x27e/0x4550 kernel/locking/lockdep.c:3385 lock_acquire+0x259/0x620 kernel/locking/lockdep.c:4002 flush_work+0xf0/0x8c0 kernel/workqueue.c:2886 hdpvr_probe+0x233/0x20d0 drivers/media/usb/hdpvr/hdpvr-core.c:400 usb_probe_interface+0x35d/0x8e0 drivers/usb/core/driver.c:361 really_probe drivers/base/dd.c:413 driver_probe_device+0x610/0xa00 drivers/base/dd.c:557 __device_attach_driver+0x230/0x290 drivers/base/dd.c:653 bus_for_each_drv+0x161/0x210 drivers/base/bus.c:463 __device_attach+0x26e/0x3d0 drivers/base/dd.c:710 device_initial_probe+0x1f/0x30 drivers/base/dd.c:757 bus_probe_device+0x1eb/0x290 drivers/base/bus.c:523 device_add+0xd0b/0x1660 drivers/base/core.c:1835 usb_set_configuration+0x104e/0x1870 drivers/usb/core/message.c:1932 generic_probe+0x73/0xe0 drivers/usb/core/generic.c:174 usb_probe_device+0xaf/0xe0 drivers/usb/core/driver.c:266 really_probe drivers/base/dd.c:413 driver_probe_device+0x610/0xa00 drivers/base/dd.c:557 __device_attach_driver+0x230/0x290 drivers/base/dd.c:653 bus_for_each_drv+0x161/0x210 drivers/base/bus.c:463 __device_attach+0x26e/0x3d0 drivers/base/dd.c:710 device_initial_probe+0x1f/0x30 drivers/base/dd.c:757 bus_probe_device+0x1eb/0x290 drivers/base/bus.c:523 device_add+0xd0b/0x1660 drivers/base/core.c:1835 usb_new_device+0x7b8/0x1020 drivers/usb/core/hub.c:2457 hub_port_connect drivers/usb/core/hub.c:4903 hub_port_connect_change drivers/usb/core/hub.c:5009 port_event drivers/usb/core/hub.c:5115 hub_event+0x194d/0x3740 drivers/usb/core/hub.c:5195 process_one_work+0xc7f/0x1db0 kernel/workqueue.c:2119 worker_thread+0x221/0x1850 kernel/workqueue.c:2253 kthread+0x3a1/0x470 kernel/kthread.c:231 ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431 hdpvr: probe of 1-1:8.217 failed with error -12 ~arvind
[PATCH v2 1/2] [media] coda: Handle return value of kasprintf
kasprintf() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- changes in v2 : Calling coda_free_framebuffers to release already allocated buffers. drivers/media/platform/coda/coda-bit.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c index 291c409..bfc4ecf 100644 --- a/drivers/media/platform/coda/coda-bit.c +++ b/drivers/media/platform/coda/coda-bit.c @@ -417,6 +417,10 @@ static int coda_alloc_framebuffers(struct coda_ctx *ctx, dev->devtype->product != CODA_DX6) size += ysize / 4; name = kasprintf(GFP_KERNEL, "fb%d", i); + if (!name) { + coda_free_framebuffers(ctx); + return -ENOMEM; + } ret = coda_alloc_context_buf(ctx, >internal_frames[i], size, name); kfree(name); -- 1.9.1
[PATCH 2/2] [media] cx23885: Handle return value of kasprintf
kasprintf() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/cx23885/cx23885-input.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/cx23885/cx23885-input.c b/drivers/media/pci/cx23885/cx23885-input.c index 944b7083..0f4e542 100644 --- a/drivers/media/pci/cx23885/cx23885-input.c +++ b/drivers/media/pci/cx23885/cx23885-input.c @@ -340,14 +340,23 @@ int cx23885_input_init(struct cx23885_dev *dev) kernel_ir->cx = dev; kernel_ir->name = kasprintf(GFP_KERNEL, "cx23885 IR (%s)", cx23885_boards[dev->board].name); + if (!kernel_ir->name) { + ret = -ENOMEM; + goto err_out_free; + } + kernel_ir->phys = kasprintf(GFP_KERNEL, "pci-%s/ir0", pci_name(dev->pci)); + if (!kernel_ir->phys) { + ret = -ENOMEM; + goto err_out_free_name; + } /* input device */ rc = rc_allocate_device(RC_DRIVER_IR_RAW); if (!rc) { ret = -ENOMEM; - goto err_out_free; + goto err_out_free_phys; } kernel_ir->rc = rc; @@ -382,9 +391,11 @@ int cx23885_input_init(struct cx23885_dev *dev) cx23885_input_ir_stop(dev); dev->kernel_ir = NULL; rc_free_device(rc); -err_out_free: +err_out_free_phys: kfree(kernel_ir->phys); +err_out_free_name: kfree(kernel_ir->name); +err_out_free: kfree(kernel_ir); return ret; } -- 1.9.1
[PATCH 1/2] [media] coda: Handle return value of kasprintf
kasprintf() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/platform/coda/coda-bit.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c index 291c409..8d78183 100644 --- a/drivers/media/platform/coda/coda-bit.c +++ b/drivers/media/platform/coda/coda-bit.c @@ -417,6 +417,9 @@ static int coda_alloc_framebuffers(struct coda_ctx *ctx, dev->devtype->product != CODA_DX6) size += ysize / 4; name = kasprintf(GFP_KERNEL, "fb%d", i); + if (!name) + return -ENOMEM; + ret = coda_alloc_context_buf(ctx, >internal_frames[i], size, name); kfree(name); -- 1.9.1
[PATCH 0/2] [media] Handle return value of kasprintf
kasprintf() can fail here and we must check its return value. Arvind Yadav (2): [PATCH 1/2][media] coda: Handle return value of kasprintf [PATCH 2/2][media] cx23885: Handle return value of kasprintf drivers/media/pci/cx23885/cx23885-input.c | 15 +-- drivers/media/platform/coda/coda-bit.c| 3 +++ 2 files changed, 16 insertions(+), 2 deletions(-) -- 1.9.1
[PATCH] Staging: atomisp: constify driver_attribute
driver_attribute are not supposed to change at runtime. Functions driver_create_file/driver_remove_file are working with const driver_attribute. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c index 1ae2358..9f74b2d 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c @@ -162,7 +162,7 @@ static ssize_t iunit_dbgopt_store(struct device_driver *drv, const char *buf, return size; } -static struct driver_attribute iunit_drvfs_attrs[] = { +static const struct driver_attribute iunit_drvfs_attrs[] = { __ATTR(dbglvl, 0644, iunit_dbglvl_show, iunit_dbglvl_store), __ATTR(dbgfun, 0644, iunit_dbgfun_show, iunit_dbgfun_store), __ATTR(dbgopt, 0644, iunit_dbgopt_show, iunit_dbgopt_store), -- 1.9.1
[PATCH] staging: atomisp: constify v4l2_subdev_sensor_ops
v4l2_subdev_sensor_ops are not supposed to change at runtime. v4l2_subdev_sensor_ops are working with const 'sensor' field of sturct v4l2_subdev_ops. So mark the non-const v4l2_subdev_sensor_ops structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/staging/media/atomisp/i2c/mt9m114.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/i2c/mt9m114.c b/drivers/staging/media/atomisp/i2c/mt9m114.c index 3fa9153..2c9b752 100644 --- a/drivers/staging/media/atomisp/i2c/mt9m114.c +++ b/drivers/staging/media/atomisp/i2c/mt9m114.c @@ -1806,7 +1806,7 @@ static const struct v4l2_subdev_video_ops mt9m114_video_ops = { .g_frame_interval = mt9m114_g_frame_interval, }; -static struct v4l2_subdev_sensor_ops mt9m114_sensor_ops = { +static const struct v4l2_subdev_sensor_ops mt9m114_sensor_ops = { .g_skip_frames = mt9m114_g_skip_frames, }; -- 2.7.4
[PATCH 1/4] [media] saa7146: constify videobuf_queue_ops structures
videobuf_queue_ops are not supposed to change at runtime. All functions working with videobuf_queue_ops provided by work with const videobuf_queue_ops. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/common/saa7146/saa7146_vbi.c | 2 +- drivers/media/common/saa7146/saa7146_video.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/common/saa7146/saa7146_vbi.c b/drivers/media/common/saa7146/saa7146_vbi.c index 3553ac4..d79e4d7 100644 --- a/drivers/media/common/saa7146/saa7146_vbi.c +++ b/drivers/media/common/saa7146/saa7146_vbi.c @@ -308,7 +308,7 @@ static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb) saa7146_dma_free(dev,q,buf); } -static struct videobuf_queue_ops vbi_qops = { +static const struct videobuf_queue_ops vbi_qops = { .buf_setup= buffer_setup, .buf_prepare = buffer_prepare, .buf_queue= buffer_queue, diff --git a/drivers/media/common/saa7146/saa7146_video.c b/drivers/media/common/saa7146/saa7146_video.c index b3b29d4..37b4654 100644 --- a/drivers/media/common/saa7146/saa7146_video.c +++ b/drivers/media/common/saa7146/saa7146_video.c @@ -1187,7 +1187,7 @@ static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb) release_all_pagetables(dev, buf); } -static struct videobuf_queue_ops video_qops = { +static const struct videobuf_queue_ops video_qops = { .buf_setup= buffer_setup, .buf_prepare = buffer_prepare, .buf_queue= buffer_queue, -- 1.9.1
[PATCH 0/4] constify videobuf_queue_ops structures
videobuf_queue_ops are not supposed to change at runtime. All functions working with videobuf_queue_ops provided by work with const videobuf_queue_ops. So mark the non-const structs as const. Arvind Yadav (4): [PATCH 1/4] [media] saa7146: constify videobuf_queue_ops structures [PATCH 2/4] [media] pci: constify videobuf_queue_ops structures [PATCH 3/4] [media] platform: constify videobuf_queue_ops structures [PATCH 4/4] [media] usb: constify videobuf_queue_ops structures drivers/media/common/saa7146/saa7146_vbi.c| 2 +- drivers/media/common/saa7146/saa7146_video.c | 2 +- drivers/media/pci/bt8xx/bttv-driver.c | 2 +- drivers/media/pci/cx18/cx18-streams.c | 2 +- drivers/media/platform/davinci/vpfe_capture.c | 2 +- drivers/media/platform/fsl-viu.c | 2 +- drivers/media/usb/cx231xx/cx231xx-417.c | 2 +- drivers/media/usb/cx231xx/cx231xx-video.c | 2 +- drivers/media/usb/tm6000/tm6000-video.c | 2 +- drivers/media/usb/zr364xx/zr364xx.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) -- 1.9.1
[PATCH 4/4] [media] usb: constify videobuf_queue_ops structures
videobuf_queue_ops are not supposed to change at runtime. All functions working with videobuf_queue_ops provided by work with const videobuf_queue_ops. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/usb/cx231xx/cx231xx-417.c | 2 +- drivers/media/usb/cx231xx/cx231xx-video.c | 2 +- drivers/media/usb/tm6000/tm6000-video.c | 2 +- drivers/media/usb/zr364xx/zr364xx.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/usb/cx231xx/cx231xx-417.c b/drivers/media/usb/cx231xx/cx231xx-417.c index 509d971..2b16808 100644 --- a/drivers/media/usb/cx231xx/cx231xx-417.c +++ b/drivers/media/usb/cx231xx/cx231xx-417.c @@ -1490,7 +1490,7 @@ static void bb_buf_release(struct videobuf_queue *q, free_buffer(q, buf); } -static struct videobuf_queue_ops cx231xx_qops = { +static const struct videobuf_queue_ops cx231xx_qops = { .buf_setup= bb_buf_setup, .buf_prepare = bb_buf_prepare, .buf_queue= bb_buf_queue, diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c index f67f868..179b848 100644 --- a/drivers/media/usb/cx231xx/cx231xx-video.c +++ b/drivers/media/usb/cx231xx/cx231xx-video.c @@ -859,7 +859,7 @@ static void buffer_release(struct videobuf_queue *vq, free_buffer(vq, buf); } -static struct videobuf_queue_ops cx231xx_video_qops = { +static const struct videobuf_queue_ops cx231xx_video_qops = { .buf_setup = buffer_setup, .buf_prepare = buffer_prepare, .buf_queue = buffer_queue, diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c index 7e960d0..35925f1 100644 --- a/drivers/media/usb/tm6000/tm6000-video.c +++ b/drivers/media/usb/tm6000/tm6000-video.c @@ -801,7 +801,7 @@ static void buffer_release(struct videobuf_queue *vq, struct videobuf_buffer *vb free_buffer(vq, buf); } -static struct videobuf_queue_ops tm6000_video_qops = { +static const struct videobuf_queue_ops tm6000_video_qops = { .buf_setup = buffer_setup, .buf_prepare= buffer_prepare, .buf_queue = buffer_queue, diff --git a/drivers/media/usb/zr364xx/zr364xx.c b/drivers/media/usb/zr364xx/zr364xx.c index efdcd5b..24d5860 100644 --- a/drivers/media/usb/zr364xx/zr364xx.c +++ b/drivers/media/usb/zr364xx/zr364xx.c @@ -439,7 +439,7 @@ static void buffer_release(struct videobuf_queue *vq, free_buffer(vq, buf); } -static struct videobuf_queue_ops zr364xx_video_qops = { +static const struct videobuf_queue_ops zr364xx_video_qops = { .buf_setup = buffer_setup, .buf_prepare = buffer_prepare, .buf_queue = buffer_queue, -- 1.9.1
[PATCH 3/4] [media] platform: constify videobuf_queue_ops structures
videobuf_queue_ops are not supposed to change at runtime. All functions working with videobuf_queue_ops provided by work with const videobuf_queue_ops. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/platform/davinci/vpfe_capture.c | 2 +- drivers/media/platform/fsl-viu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c index b1bf4a7..6792da1 100644 --- a/drivers/media/platform/davinci/vpfe_capture.c +++ b/drivers/media/platform/davinci/vpfe_capture.c @@ -1288,7 +1288,7 @@ static void vpfe_videobuf_release(struct videobuf_queue *vq, vb->state = VIDEOBUF_NEEDS_INIT; } -static struct videobuf_queue_ops vpfe_videobuf_qops = { +static const struct videobuf_queue_ops vpfe_videobuf_qops = { .buf_setup = vpfe_videobuf_setup, .buf_prepare= vpfe_videobuf_prepare, .buf_queue = vpfe_videobuf_queue, diff --git a/drivers/media/platform/fsl-viu.c b/drivers/media/platform/fsl-viu.c index 97e164b..2aac8e8 100644 --- a/drivers/media/platform/fsl-viu.c +++ b/drivers/media/platform/fsl-viu.c @@ -549,7 +549,7 @@ static void buffer_release(struct videobuf_queue *vq, free_buffer(vq, buf); } -static struct videobuf_queue_ops viu_video_qops = { +static const struct videobuf_queue_ops viu_video_qops = { .buf_setup = buffer_setup, .buf_prepare= buffer_prepare, .buf_queue = buffer_queue, -- 1.9.1
[PATCH 2/4] [media] pci: constify videobuf_queue_ops structures
videobuf_queue_ops are not supposed to change at runtime. All functions working with videobuf_queue_ops provided by work with const videobuf_queue_ops. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/bt8xx/bttv-driver.c | 2 +- drivers/media/pci/cx18/cx18-streams.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index ed319f1..c2f1ba0 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers/media/pci/bt8xx/bttv-driver.c @@ -1702,7 +1702,7 @@ static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb) bttv_dma_free(q,fh->btv,buf); } -static struct videobuf_queue_ops bttv_video_qops = { +static const struct videobuf_queue_ops bttv_video_qops = { .buf_setup= buffer_setup, .buf_prepare = buffer_prepare, .buf_queue= buffer_queue, diff --git a/drivers/media/pci/cx18/cx18-streams.c b/drivers/media/pci/cx18/cx18-streams.c index 3c45e007..81d06c1 100644 --- a/drivers/media/pci/cx18/cx18-streams.c +++ b/drivers/media/pci/cx18/cx18-streams.c @@ -240,7 +240,7 @@ static void buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb) list_add_tail(>vb.queue, >vb_capture); } -static struct videobuf_queue_ops cx18_videobuf_qops = { +static const struct videobuf_queue_ops cx18_videobuf_qops = { .buf_setup= buffer_setup, .buf_prepare = buffer_prepare, .buf_queue= buffer_queue, -- 1.9.1
[PATCH 2/6] [media] adv7511: constify i2c_device_id
i2c_device_id are not supposed to change at runtime. All functions working with i2c_device_id provided by work with const i2c_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/i2c/adv7511.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/adv7511.c b/drivers/media/i2c/adv7511.c index ccc4786..8fc97a8 100644 --- a/drivers/media/i2c/adv7511.c +++ b/drivers/media/i2c/adv7511.c @@ -1986,7 +1986,7 @@ static int adv7511_remove(struct i2c_client *client) /* --- */ -static struct i2c_device_id adv7511_id[] = { +static const struct i2c_device_id adv7511_id[] = { { "adv7511", 0 }, { } }; -- 2.7.4
[PATCH 0/6] constify media i2c_device_id
i2c_device_id are not supposed to change at runtime. All functions working with i2c_device_id provided by work with const i2c_device_id. So mark the non-const structs as const. Arvind Yadav (6): [PATCH 1/6] [media] ad9389b: constify i2c_device_id [PATCH 2/6] [media] adv7511: constify i2c_device_id [PATCH 3/6] [media] adv7842: constify i2c_device_id [PATCH 4/6] [media] saa7127: constify i2c_device_id [PATCH 5/6] [media] tc358743: constify i2c_device_id [PATCH 6/6] [media] ths8200: constify i2c_device_id drivers/media/i2c/ad9389b.c | 2 +- drivers/media/i2c/adv7511.c | 2 +- drivers/media/i2c/adv7842.c | 2 +- drivers/media/i2c/saa7127.c | 2 +- drivers/media/i2c/tc358743.c | 2 +- drivers/media/i2c/ths8200.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) -- 2.7.4
[PATCH 4/6] [media] saa7127: constify i2c_device_id
i2c_device_id are not supposed to change at runtime. All functions working with i2c_device_id provided by work with const i2c_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/i2c/saa7127.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/saa7127.c b/drivers/media/i2c/saa7127.c index 99c3030..01784d4 100644 --- a/drivers/media/i2c/saa7127.c +++ b/drivers/media/i2c/saa7127.c @@ -806,7 +806,7 @@ static int saa7127_remove(struct i2c_client *client) /* --- */ -static struct i2c_device_id saa7127_id[] = { +static const struct i2c_device_id saa7127_id[] = { { "saa7127_auto", 0 }, /* auto-detection */ { "saa7126", SAA7127 }, { "saa7127", SAA7127 }, -- 2.7.4
[PATCH 1/6] [media] ad9389b: constify i2c_device_id
i2c_device_id are not supposed to change at runtime. All functions working with i2c_device_id provided by work with const i2c_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/i2c/ad9389b.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/ad9389b.c b/drivers/media/i2c/ad9389b.c index 50f3541..a056d6c 100644 --- a/drivers/media/i2c/ad9389b.c +++ b/drivers/media/i2c/ad9389b.c @@ -1208,7 +1208,7 @@ static int ad9389b_remove(struct i2c_client *client) /* --- */ -static struct i2c_device_id ad9389b_id[] = { +static const struct i2c_device_id ad9389b_id[] = { { "ad9389b", 0 }, { "ad9889b", 0 }, { } -- 2.7.4
[PATCH 3/6] [media] adv7842: constify i2c_device_id
i2c_device_id are not supposed to change at runtime. All functions working with i2c_device_id provided by work with const i2c_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/i2c/adv7842.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c index 303effd..9b959ec 100644 --- a/drivers/media/i2c/adv7842.c +++ b/drivers/media/i2c/adv7842.c @@ -3608,7 +3608,7 @@ static int adv7842_remove(struct i2c_client *client) /* --- */ -static struct i2c_device_id adv7842_id[] = { +static const struct i2c_device_id adv7842_id[] = { { "adv7842", 0 }, { } }; -- 2.7.4
[PATCH 6/6] [media] ths8200: constify i2c_device_id
i2c_device_id are not supposed to change at runtime. All functions working with i2c_device_id provided by work with const i2c_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/i2c/ths8200.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/ths8200.c b/drivers/media/i2c/ths8200.c index 42340e3..498ad23 100644 --- a/drivers/media/i2c/ths8200.c +++ b/drivers/media/i2c/ths8200.c @@ -483,7 +483,7 @@ static int ths8200_remove(struct i2c_client *client) return 0; } -static struct i2c_device_id ths8200_id[] = { +static const struct i2c_device_id ths8200_id[] = { { "ths8200", 0 }, {}, }; -- 2.7.4
[PATCH 5/6] [media] tc358743: constify i2c_device_id
i2c_device_id are not supposed to change at runtime. All functions working with i2c_device_id provided by work with const i2c_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/i2c/tc358743.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c index 5788af2..e6f5c36 100644 --- a/drivers/media/i2c/tc358743.c +++ b/drivers/media/i2c/tc358743.c @@ -2013,7 +2013,7 @@ static int tc358743_remove(struct i2c_client *client) return 0; } -static struct i2c_device_id tc358743_id[] = { +static const struct i2c_device_id tc358743_id[] = { {"tc358743", 0}, {} }; -- 2.7.4
[PATCH] [media] usb: rainshadow-cec: constify serio_device_id
serio_device_id are not supposed to change at runtime. All functions working with serio_device_id provided by work with const serio_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/usb/rainshadow-cec/rainshadow-cec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/rainshadow-cec/rainshadow-cec.c b/drivers/media/usb/rainshadow-cec/rainshadow-cec.c index f203699..b82e37c 100644 --- a/drivers/media/usb/rainshadow-cec/rainshadow-cec.c +++ b/drivers/media/usb/rainshadow-cec/rainshadow-cec.c @@ -361,7 +361,7 @@ static int rain_connect(struct serio *serio, struct serio_driver *drv) return err; } -static struct serio_device_id rain_serio_ids[] = { +static const struct serio_device_id rain_serio_ids[] = { { .type = SERIO_RS232, .proto = SERIO_RAINSHADOW_CEC, -- 2.7.4
[PATCH] [media] usb: pulse8-cec: constify serio_device_id
serio_device_id are not supposed to change at runtime. All functions working with serio_device_id provided by work with const serio_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/usb/pulse8-cec/pulse8-cec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/pulse8-cec/pulse8-cec.c b/drivers/media/usb/pulse8-cec/pulse8-cec.c index c843070..d10d803 100644 --- a/drivers/media/usb/pulse8-cec/pulse8-cec.c +++ b/drivers/media/usb/pulse8-cec/pulse8-cec.c @@ -732,7 +732,7 @@ static void pulse8_ping_eeprom_work_handler(struct work_struct *work) mutex_unlock(>config_lock); } -static struct serio_device_id pulse8_serio_ids[] = { +static const struct serio_device_id pulse8_serio_ids[] = { { .type = SERIO_RS232, .proto = SERIO_PULSE8_CEC, -- 2.7.4
[PATCH] [media] radio: constify pnp_device_id
pnp_device_id are not supposed to change at runtime. All functions working with pnp_device_id provided by work with const pnp_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/radio/radio-cadet.c| 2 +- drivers/media/radio/radio-gemtek.c | 2 +- drivers/media/radio/radio-sf16fmr2.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c index cbaf850..6888b7d 100644 --- a/drivers/media/radio/radio-cadet.c +++ b/drivers/media/radio/radio-cadet.c @@ -528,7 +528,7 @@ static const struct v4l2_ctrl_ops cadet_ctrl_ops = { #ifdef CONFIG_PNP -static struct pnp_device_id cadet_pnp_devices[] = { +static const struct pnp_device_id cadet_pnp_devices[] = { /* ADS Cadet AM/FM Radio Card */ {.id = "MSM0c24", .driver_data = 0}, {.id = ""} diff --git a/drivers/media/radio/radio-gemtek.c b/drivers/media/radio/radio-gemtek.c index ca051ccb..ddc12b1 100644 --- a/drivers/media/radio/radio-gemtek.c +++ b/drivers/media/radio/radio-gemtek.c @@ -281,7 +281,7 @@ static const struct radio_isa_ops gemtek_ops = { static const int gemtek_ioports[] = { 0x20c, 0x30c, 0x24c, 0x34c, 0x248, 0x28c }; #ifdef CONFIG_PNP -static struct pnp_device_id gemtek_pnp_devices[] = { +static const struct pnp_device_id gemtek_pnp_devices[] = { /* AOpen FX-3D/Pro Radio */ {.id = "ADS7183", .driver_data = 0}, {.id = ""} diff --git a/drivers/media/radio/radio-sf16fmr2.c b/drivers/media/radio/radio-sf16fmr2.c index dc81d42..de79d55 100644 --- a/drivers/media/radio/radio-sf16fmr2.c +++ b/drivers/media/radio/radio-sf16fmr2.c @@ -197,7 +197,7 @@ static int fmr2_tea_ext_init(struct snd_tea575x *tea) return 0; } -static struct pnp_device_id fmr2_pnp_ids[] = { +static const struct pnp_device_id fmr2_pnp_ids[] = { { .id = "MFRad13" }, /* tuner subdevice of SF16-FMD2 */ { .id = "" } }; -- 2.7.4
[PATCH 3/3] [media] omap3isp: constify platform_device_id
platform_device_id are not supposed to change at runtime. All functions working with platform_device_id provided by work with const platform_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/platform/omap3isp/isp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c index 9df64c1..ddb2cf5 100644 --- a/drivers/media/platform/omap3isp/isp.c +++ b/drivers/media/platform/omap3isp/isp.c @@ -2373,7 +2373,7 @@ static const struct dev_pm_ops omap3isp_pm_ops = { .complete = isp_pm_complete, }; -static struct platform_device_id omap3isp_id_table[] = { +static const struct platform_device_id omap3isp_id_table[] = { { "omap3isp", 0 }, { }, }; -- 2.7.4
[PATCH 1/3] [media] coda: constify platform_device_id
platform_device_id are not supposed to change at runtime. All functions working with platform_device_id provided by work with const platform_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/platform/coda/coda-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c index f92cc7d..530c937 100644 --- a/drivers/media/platform/coda/coda-common.c +++ b/drivers/media/platform/coda/coda-common.c @@ -2390,7 +2390,7 @@ static const struct coda_devtype coda_devdata[] = { }, }; -static struct platform_device_id coda_platform_ids[] = { +static const struct platform_device_id coda_platform_ids[] = { { .name = "coda-imx27", .driver_data = CODA_IMX27 }, { /* sentinel */ } }; -- 2.7.4
[PATCH 2/3] [media] davinci: constify platform_device_id
platform_device_id are not supposed to change at runtime. All functions working with platform_device_id provided by work with const platform_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/platform/davinci/vpbe_osd.c | 2 +- drivers/media/platform/davinci/vpbe_venc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/davinci/vpbe_osd.c b/drivers/media/platform/davinci/vpbe_osd.c index df042e8..6644979 100644 --- a/drivers/media/platform/davinci/vpbe_osd.c +++ b/drivers/media/platform/davinci/vpbe_osd.c @@ -37,7 +37,7 @@ #define MODULE_NAME"davinci-vpbe-osd" -static struct platform_device_id vpbe_osd_devtype[] = { +static const struct platform_device_id vpbe_osd_devtype[] = { { .name = DM644X_VPBE_OSD_SUBDEV_NAME, .driver_data = VPBE_VERSION_1, diff --git a/drivers/media/platform/davinci/vpbe_venc.c b/drivers/media/platform/davinci/vpbe_venc.c index 8bfe90a..3a4e785 100644 --- a/drivers/media/platform/davinci/vpbe_venc.c +++ b/drivers/media/platform/davinci/vpbe_venc.c @@ -36,7 +36,7 @@ #define MODULE_NAME"davinci-vpbe-venc" -static struct platform_device_id vpbe_venc_devtype[] = { +static const struct platform_device_id vpbe_venc_devtype[] = { { .name = DM644X_VPBE_VENC_SUBDEV_NAME, .driver_data = VPBE_VERSION_1, -- 2.7.4
[PATCH 0/3] constify media platform_device_id
platform_device_id are not supposed to change at runtime. All functions working with platform_device_id provided by work with const platform_device_id. So mark the non-const structs as const. Arvind Yadav (3): [PATCH 1/3] [media] coda: constify platform_device_id [PATCH 2/3] [media] davinci: constify platform_device_id [PATCH 3/3] [media] omap3isp: constify platform_device_id drivers/media/platform/coda/coda-common.c | 2 +- drivers/media/platform/davinci/vpbe_osd.c | 2 +- drivers/media/platform/davinci/vpbe_venc.c | 2 +- drivers/media/platform/omap3isp/isp.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) -- 2.7.4
[PATCH 0/3] constify media usb_device_id
usb_device_id are not supposed to change at runtime. All functions working with usb_device_id provided by work with const usb_device_id. So mark the non-const structs as const. Arvind Yadav (3): [PATCH 1/3] [media] usb: constify usb_device_id [PATCH 2/3] [media] rc: constify usb_device_id [PATCH 3/3] [media] radio: constify usb_device_id drivers/media/radio/dsbr100.c | 2 +- drivers/media/radio/radio-keene.c | 2 +- drivers/media/radio/radio-ma901.c | 2 +- drivers/media/radio/radio-mr800.c | 2 +- drivers/media/radio/radio-raremono.c | 2 +- drivers/media/radio/radio-shark.c | 2 +- drivers/media/radio/radio-shark2.c| 2 +- drivers/media/radio/si470x/radio-si470x-usb.c | 2 +- drivers/media/radio/si4713/radio-usb-si4713.c | 2 +- drivers/media/rc/ati_remote.c | 2 +- drivers/media/rc/igorplugusb.c| 2 +- drivers/media/rc/imon.c | 2 +- drivers/media/rc/mceusb.c | 2 +- drivers/media/rc/redrat3.c| 2 +- drivers/media/rc/streamzap.c | 2 +- drivers/media/usb/airspy/airspy.c | 2 +- drivers/media/usb/as102/as102_usb_drv.c | 2 +- drivers/media/usb/b2c2/flexcop-usb.c | 2 +- drivers/media/usb/cpia2/cpia2_usb.c | 2 +- drivers/media/usb/dvb-usb-v2/az6007.c | 2 +- drivers/media/usb/hackrf/hackrf.c | 2 +- drivers/media/usb/hdpvr/hdpvr-core.c | 2 +- drivers/media/usb/msi2500/msi2500.c | 2 +- drivers/media/usb/s2255/s2255drv.c| 2 +- drivers/media/usb/stk1160/stk1160-core.c | 2 +- drivers/media/usb/stkwebcam/stk-webcam.c | 2 +- drivers/media/usb/tm6000/tm6000-cards.c | 2 +- drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c | 2 +- drivers/media/usb/ttusb-dec/ttusb_dec.c | 2 +- drivers/media/usb/usbtv/usbtv-core.c | 2 +- drivers/media/usb/uvc/uvc_driver.c| 2 +- drivers/media/usb/zr364xx/zr364xx.c | 2 +- 32 files changed, 32 insertions(+), 32 deletions(-) -- 2.7.4
[PATCH 3/3] [media] radio: constify usb_device_id
usb_device_id are not supposed to change at runtime. All functions working with usb_device_id provided by work with const usb_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/radio/dsbr100.c | 2 +- drivers/media/radio/radio-keene.c | 2 +- drivers/media/radio/radio-ma901.c | 2 +- drivers/media/radio/radio-mr800.c | 2 +- drivers/media/radio/radio-raremono.c | 2 +- drivers/media/radio/radio-shark.c | 2 +- drivers/media/radio/radio-shark2.c| 2 +- drivers/media/radio/si470x/radio-si470x-usb.c | 2 +- drivers/media/radio/si4713/radio-usb-si4713.c | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c index 53bc8c0..8521bb2 100644 --- a/drivers/media/radio/dsbr100.c +++ b/drivers/media/radio/dsbr100.c @@ -408,7 +408,7 @@ static int usb_dsbr100_probe(struct usb_interface *intf, return retval; } -static struct usb_device_id usb_dsbr100_device_table[] = { +static const struct usb_device_id usb_dsbr100_device_table[] = { { USB_DEVICE(DSB100_VENDOR, DSB100_PRODUCT) }, { } /* Terminating entry */ }; diff --git a/drivers/media/radio/radio-keene.c b/drivers/media/radio/radio-keene.c index 53a7c2e..f2ea8bc 100644 --- a/drivers/media/radio/radio-keene.c +++ b/drivers/media/radio/radio-keene.c @@ -45,7 +45,7 @@ MODULE_LICENSE("GPL"); #define FREQ_MUL 16000U /* USB Device ID List */ -static struct usb_device_id usb_keene_device_table[] = { +static const struct usb_device_id usb_keene_device_table[] = { {USB_DEVICE_AND_INTERFACE_INFO(USB_KEENE_VENDOR, USB_KEENE_PRODUCT, USB_CLASS_HID, 0, 0) }, { } /* Terminating entry */ diff --git a/drivers/media/radio/radio-ma901.c b/drivers/media/radio/radio-ma901.c index c2010a9..fdc4812 100644 --- a/drivers/media/radio/radio-ma901.c +++ b/drivers/media/radio/radio-ma901.c @@ -444,7 +444,7 @@ static int usb_ma901radio_probe(struct usb_interface *intf, } /* USB Device ID List */ -static struct usb_device_id usb_ma901radio_device_table[] = { +static const struct usb_device_id usb_ma901radio_device_table[] = { { USB_DEVICE_AND_INTERFACE_INFO(USB_MA901_VENDOR, USB_MA901_PRODUCT, USB_CLASS_HID, 0, 0) }, { } /* Terminating entry */ diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c index 95c1253..c9f5912 100644 --- a/drivers/media/radio/radio-mr800.c +++ b/drivers/media/radio/radio-mr800.c @@ -587,7 +587,7 @@ static int usb_amradio_probe(struct usb_interface *intf, } /* USB Device ID List */ -static struct usb_device_id usb_amradio_device_table[] = { +static const struct usb_device_id usb_amradio_device_table[] = { { USB_DEVICE_AND_INTERFACE_INFO(USB_AMRADIO_VENDOR, USB_AMRADIO_PRODUCT, USB_CLASS_HID, 0, 0) }, { } /* Terminating entry */ diff --git a/drivers/media/radio/radio-raremono.c b/drivers/media/radio/radio-raremono.c index bfb3a6d..3c0a22a 100644 --- a/drivers/media/radio/radio-raremono.c +++ b/drivers/media/radio/radio-raremono.c @@ -58,7 +58,7 @@ MODULE_LICENSE("GPL v2"); */ /* USB Device ID List */ -static struct usb_device_id usb_raremono_device_table[] = { +static const struct usb_device_id usb_raremono_device_table[] = { {USB_DEVICE_AND_INTERFACE_INFO(0x10c4, 0x818a, USB_CLASS_HID, 0, 0) }, { } /* Terminating entry */ }; diff --git a/drivers/media/radio/radio-shark.c b/drivers/media/radio/radio-shark.c index 23971f5..22f3466 100644 --- a/drivers/media/radio/radio-shark.c +++ b/drivers/media/radio/radio-shark.c @@ -392,7 +392,7 @@ static int usb_shark_resume(struct usb_interface *intf) #endif /* Specify the bcdDevice value, as the radioSHARK and radioSHARK2 share ids */ -static struct usb_device_id usb_shark_device_table[] = { +static const struct usb_device_id usb_shark_device_table[] = { { .match_flags = USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION | USB_DEVICE_ID_MATCH_INT_CLASS, .idVendor = 0x077d, diff --git a/drivers/media/radio/radio-shark2.c b/drivers/media/radio/radio-shark2.c index b50638e..4d1a4b3 100644 --- a/drivers/media/radio/radio-shark2.c +++ b/drivers/media/radio/radio-shark2.c @@ -358,7 +358,7 @@ static int usb_shark_resume(struct usb_interface *intf) #endif /* Specify the bcdDevice value, as the radioSHARK and radioSHARK2 share ids */ -static struct usb_device_id usb_shark_device_table[] = { +static
[PATCH 2/3] [media] rc: constify usb_device_id
usb_device_id are not supposed to change at runtime. All functions working with usb_device_id provided by work with const usb_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/rc/ati_remote.c | 2 +- drivers/media/rc/igorplugusb.c | 2 +- drivers/media/rc/imon.c| 2 +- drivers/media/rc/mceusb.c | 2 +- drivers/media/rc/redrat3.c | 2 +- drivers/media/rc/streamzap.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c index a4c6ad4..d1d0c48 100644 --- a/drivers/media/rc/ati_remote.c +++ b/drivers/media/rc/ati_remote.c @@ -198,7 +198,7 @@ static const struct ati_receiver_type type_firefly = { .default_keymap = RC_MAP_SNAPSTREAM_FIREFLY }; -static struct usb_device_id ati_remote_table[] = { +static const struct usb_device_id ati_remote_table[] = { { USB_DEVICE(ATI_REMOTE_VENDOR_ID, LOLA_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)_ati diff --git a/drivers/media/rc/igorplugusb.c b/drivers/media/rc/igorplugusb.c index cb6d4f1..c294ec5 100644 --- a/drivers/media/rc/igorplugusb.c +++ b/drivers/media/rc/igorplugusb.c @@ -244,7 +244,7 @@ static void igorplugusb_disconnect(struct usb_interface *intf) usb_free_urb(ir->urb); } -static struct usb_device_id igorplugusb_table[] = { +static const struct usb_device_id igorplugusb_table[] = { /* Igor Plug USB (Atmel's Manufact. ID) */ { USB_DEVICE(0x03eb, 0x0002) }, /* Fit PC2 Infrared Adapter */ diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index bd76534..3f414ab 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c @@ -346,7 +346,7 @@ static const struct imon_usb_dev_descr imon_ir_raw = { * devices use the SoundGraph vendor ID (0x15c2). This driver only supports * the ffdc and later devices, which do onboard decoding. */ -static struct usb_device_id imon_usb_id_table[] = { +static const struct usb_device_id imon_usb_id_table[] = { /* * Several devices with this same device ID, all use iMON_PAD.inf * SoundGraph iMON PAD (IR & VFD) diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index eb13069..6664d91 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -249,7 +249,7 @@ static const struct mceusb_model mceusb_model[] = { }, }; -static struct usb_device_id mceusb_dev_table[] = { +static const struct usb_device_id mceusb_dev_table[] = { /* Original Microsoft MCE IR Transceiver (often HP-branded) */ { USB_DEVICE(VENDOR_MICROSOFT, 0x006d), .driver_info = MCE_GEN1 }, diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c index 56d43be..48f27ac 100644 --- a/drivers/media/rc/redrat3.c +++ b/drivers/media/rc/redrat3.c @@ -186,7 +186,7 @@ struct redrat3_error { } __packed; /* table of devices that work with this driver */ -static struct usb_device_id redrat3_dev_table[] = { +static const struct usb_device_id redrat3_dev_table[] = { /* Original version of the RedRat3 */ {USB_DEVICE(USB_RR3USB_VENDOR_ID, USB_RR3USB_PRODUCT_ID)}, /* Second Version/release of the RedRat3 - RetRat3-II */ diff --git a/drivers/media/rc/streamzap.c b/drivers/media/rc/streamzap.c index b09c45a..1f00727 100644 --- a/drivers/media/rc/streamzap.c +++ b/drivers/media/rc/streamzap.c @@ -43,7 +43,7 @@ #define USB_STREAMZAP_PRODUCT_ID 0x /* table of devices that work with this driver */ -static struct usb_device_id streamzap_table[] = { +static const struct usb_device_id streamzap_table[] = { /* Streamzap Remote Control */ { USB_DEVICE(USB_STREAMZAP_VENDOR_ID, USB_STREAMZAP_PRODUCT_ID) }, /* Terminating entry */ -- 2.7.4
[PATCH 1/3] [media] usb: constify usb_device_id
usb_device_id are not supposed to change at runtime. All functions working with usb_device_id provided by work with const usb_device_id. So mark the non-const structs as const. 'drivers/media/usb/b2c2/flexcop-usb.c' Fix checkpatch.pl error: ERROR: space prohibited before open square bracket '['. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/usb/airspy/airspy.c | 2 +- drivers/media/usb/as102/as102_usb_drv.c | 2 +- drivers/media/usb/b2c2/flexcop-usb.c | 2 +- drivers/media/usb/cpia2/cpia2_usb.c | 2 +- drivers/media/usb/dvb-usb-v2/az6007.c | 2 +- drivers/media/usb/hackrf/hackrf.c | 2 +- drivers/media/usb/hdpvr/hdpvr-core.c | 2 +- drivers/media/usb/msi2500/msi2500.c | 2 +- drivers/media/usb/s2255/s2255drv.c| 2 +- drivers/media/usb/stk1160/stk1160-core.c | 2 +- drivers/media/usb/stkwebcam/stk-webcam.c | 2 +- drivers/media/usb/tm6000/tm6000-cards.c | 2 +- drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c | 2 +- drivers/media/usb/ttusb-dec/ttusb_dec.c | 2 +- drivers/media/usb/usbtv/usbtv-core.c | 2 +- drivers/media/usb/uvc/uvc_driver.c| 2 +- drivers/media/usb/zr364xx/zr364xx.c | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/media/usb/airspy/airspy.c b/drivers/media/usb/airspy/airspy.c index 8251942..07f3f4e 100644 --- a/drivers/media/usb/airspy/airspy.c +++ b/drivers/media/usb/airspy/airspy.c @@ -1087,7 +1087,7 @@ static int airspy_probe(struct usb_interface *intf, } /* USB device ID list */ -static struct usb_device_id airspy_id_table[] = { +static const struct usb_device_id airspy_id_table[] = { { USB_DEVICE(0x1d50, 0x60a1) }, /* AirSpy */ { } }; diff --git a/drivers/media/usb/as102/as102_usb_drv.c b/drivers/media/usb/as102/as102_usb_drv.c index 68c3a80..ea57859 100644 --- a/drivers/media/usb/as102/as102_usb_drv.c +++ b/drivers/media/usb/as102/as102_usb_drv.c @@ -33,7 +33,7 @@ static void as102_usb_stop_stream(struct as102_dev_t *dev); static int as102_open(struct inode *inode, struct file *file); static int as102_release(struct inode *inode, struct file *file); -static struct usb_device_id as102_usb_id_table[] = { +static const struct usb_device_id as102_usb_id_table[] = { { USB_DEVICE(AS102_USB_DEVICE_VENDOR_ID, AS102_USB_DEVICE_PID_0001) }, { USB_DEVICE(PCTV_74E_USB_VID, PCTV_74E_USB_PID) }, { USB_DEVICE(ELGATO_EYETV_DTT_USB_VID, ELGATO_EYETV_DTT_USB_PID) }, diff --git a/drivers/media/usb/b2c2/flexcop-usb.c b/drivers/media/usb/b2c2/flexcop-usb.c index 788c738..2fb5a54 100644 --- a/drivers/media/usb/b2c2/flexcop-usb.c +++ b/drivers/media/usb/b2c2/flexcop-usb.c @@ -596,7 +596,7 @@ static void flexcop_usb_disconnect(struct usb_interface *intf) info("%s successfully deinitialized and disconnected.", DRIVER_NAME); } -static struct usb_device_id flexcop_usb_table [] = { +static const struct usb_device_id flexcop_usb_table[] = { { USB_DEVICE(0x0af7, 0x0101) }, { } }; diff --git a/drivers/media/usb/cpia2/cpia2_usb.c b/drivers/media/usb/cpia2/cpia2_usb.c index 1c7e16e..6089036 100644 --- a/drivers/media/usb/cpia2/cpia2_usb.c +++ b/drivers/media/usb/cpia2/cpia2_usb.c @@ -60,7 +60,7 @@ static int submit_urbs(struct camera_data *cam); static int set_alternate(struct camera_data *cam, unsigned int alt); static int configure_transfer_mode(struct camera_data *cam, unsigned int alt); -static struct usb_device_id cpia2_id_table[] = { +static const struct usb_device_id cpia2_id_table[] = { {USB_DEVICE(0x0553, 0x0100)}, {USB_DEVICE(0x0553, 0x0140)}, {USB_DEVICE(0x0553, 0x0151)}, /* STV0676 */ diff --git a/drivers/media/usb/dvb-usb-v2/az6007.c b/drivers/media/usb/dvb-usb-v2/az6007.c index 50c07fe..72f2630 100644 --- a/drivers/media/usb/dvb-usb-v2/az6007.c +++ b/drivers/media/usb/dvb-usb-v2/az6007.c @@ -933,7 +933,7 @@ static struct dvb_usb_device_properties az6007_cablestar_hdci_props = { } }; -static struct usb_device_id az6007_usb_table[] = { +static const struct usb_device_id az6007_usb_table[] = { {DVB_USB_DEVICE(USB_VID_AZUREWAVE, USB_PID_AZUREWAVE_6007, _props, "Azurewave 6007", RC_MAP_EMPTY)}, {DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_H7, diff --git a/drivers/media/usb/hackrf/hackrf.c b/drivers/media/usb/hackrf/hackrf.c index d9a5252..a41b305 100644 --- a/drivers/media/usb/hackrf/hackrf.c +++ b/drivers/media/usb/hackrf/hackrf.c @@ -1545,7 +1545,7 @@ static int hackrf_probe(struct usb_interface *intf, } /* USB device ID list */ -static struct usb_device_id hackrf_id_table[] = { +static const struct usb_device_id hackrf_id_table[] = { { USB_DEVICE(0x1d50, 0x6089) }, /* HackRF One */ { } }; diff --git a/drivers/media/usb/hdpvr/hdp
[PATCH 0/9] constify media pci_device_id/pci_tbl.
SAA7146 DVD card base pci device id const. Arvind Yadav (9): [PATCH 1/9] [media] drv-intf: saa7146: constify pci_device_id. [PATCH 2/9] [media] ttpci: budget: constify pci_device_id. [PATCH 3/9] [media] ttpci: budget-patch: constify pci_device_id. [PATCH 4/9] [media] ttpci: budget-ci: constify pci_device_id. [PATCH 5/9] [media] ttpci: budget-av: constify pci_device_id. [PATCH 6/9] [media] ttpci: av7110: constify pci_device_id. [PATCH 7/9] [media] saa7146: mxb: constify pci_device_id. [PATCH 8/9] [media] saa7146: hexium_orion: constify pci_device_id. [PATCH 9/9] [media] saa7146: hexium_gemini: constify pci_device_id. drivers/media/pci/saa7146/hexium_gemini.c | 2 +- drivers/media/pci/saa7146/hexium_orion.c | 2 +- drivers/media/pci/saa7146/mxb.c | 2 +- drivers/media/pci/ttpci/av7110.c | 2 +- drivers/media/pci/ttpci/budget-av.c | 2 +- drivers/media/pci/ttpci/budget-ci.c | 2 +- drivers/media/pci/ttpci/budget-patch.c| 2 +- drivers/media/pci/ttpci/budget.c | 2 +- include/media/drv-intf/saa7146.h | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) -- 2.7.4
[PATCH 1/9] [media] drv-intf: saa7146: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by work with const pci_device_id. So mark the non-const structs as const. So making 'pci_tbl' as const member of 'struct saa7146_extension'. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- include/media/drv-intf/saa7146.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/media/drv-intf/saa7146.h b/include/media/drv-intf/saa7146.h index 96058a5..4529432 100644 --- a/include/media/drv-intf/saa7146.h +++ b/include/media/drv-intf/saa7146.h @@ -96,7 +96,7 @@ struct saa7146_extension supported devices, last entry 0x, 0xfff */ struct module *module; struct pci_driver driver; - struct pci_device_id *pci_tbl; + const struct pci_device_id *pci_tbl; /* extension functions */ int (*probe)(struct saa7146_dev *); -- 2.7.4
[PATCH 2/9] [media] ttpci: budget: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by and work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/ttpci/budget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/ttpci/budget.c b/drivers/media/pci/ttpci/budget.c index 81fe35c..f59eadb 100644 --- a/drivers/media/pci/ttpci/budget.c +++ b/drivers/media/pci/ttpci/budget.c @@ -845,7 +845,7 @@ MAKE_BUDGET_INFO(fsact1, "Fujitsu Siemens Activy Budget-T PCI (rev AL/ALPS TDHD1 MAKE_BUDGET_INFO(omicom, "Omicom S2 PCI", BUDGET_TT); MAKE_BUDGET_INFO(sylt, "Philips Semi Sylt PCI", BUDGET_TT_HW_DISEQC); -static struct pci_device_id pci_tbl[] = { +static const struct pci_device_id pci_tbl[] = { MAKE_EXTENSION_PCI(ttbs, 0x13c2, 0x1003), MAKE_EXTENSION_PCI(ttbc, 0x13c2, 0x1004), MAKE_EXTENSION_PCI(ttbt, 0x13c2, 0x1005), -- 2.7.4
[PATCH 4/9] [media] ttpci: budget-ci: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by and work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/ttpci/budget-ci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/ttpci/budget-ci.c b/drivers/media/pci/ttpci/budget-ci.c index 11b9227..5b8aab4 100644 --- a/drivers/media/pci/ttpci/budget-ci.c +++ b/drivers/media/pci/ttpci/budget-ci.c @@ -1538,7 +1538,7 @@ MAKE_BUDGET_INFO(ttc1501, "TT-Budget C-1501 PCI", BUDGET_TT); MAKE_BUDGET_INFO(tt3200, "TT-Budget S2-3200 PCI", BUDGET_TT); MAKE_BUDGET_INFO(ttbs1500b, "TT-Budget S-1500B PCI", BUDGET_TT); -static struct pci_device_id pci_tbl[] = { +static const struct pci_device_id pci_tbl[] = { MAKE_EXTENSION_PCI(ttbci, 0x13c2, 0x100c), MAKE_EXTENSION_PCI(ttbci, 0x13c2, 0x100f), MAKE_EXTENSION_PCI(ttbcci, 0x13c2, 0x1010), -- 2.7.4
[PATCH 5/9] [media] ttpci: budget-av: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by and work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/ttpci/budget-av.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/ttpci/budget-av.c b/drivers/media/pci/ttpci/budget-av.c index dc7be8f..ac83fff 100644 --- a/drivers/media/pci/ttpci/budget-av.c +++ b/drivers/media/pci/ttpci/budget-av.c @@ -1567,7 +1567,7 @@ MAKE_BUDGET_INFO(cin1200c, "Terratec Cinergy 1200 DVB-C", BUDGET_CIN1200C); MAKE_BUDGET_INFO(cin1200cmk3, "Terratec Cinergy 1200 DVB-C MK3", BUDGET_CIN1200C_MK3); MAKE_BUDGET_INFO(cin1200t, "Terratec Cinergy 1200 DVB-T", BUDGET_CIN1200T); -static struct pci_device_id pci_tbl[] = { +static const struct pci_device_id pci_tbl[] = { MAKE_EXTENSION_PCI(knc1s, 0x1131, 0x4f56), MAKE_EXTENSION_PCI(knc1s, 0x1131, 0x0010), MAKE_EXTENSION_PCI(knc1s, 0x1894, 0x0010), -- 2.7.4
[PATCH 6/9] [media] ttpci: av7110: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by and work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/ttpci/av7110.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/ttpci/av7110.c b/drivers/media/pci/ttpci/av7110.c index f2905bd..f46947d 100644 --- a/drivers/media/pci/ttpci/av7110.c +++ b/drivers/media/pci/ttpci/av7110.c @@ -2872,7 +2872,7 @@ MAKE_AV7110_INFO(fsc,"Fujitsu Siemens DVB-C"); MAKE_AV7110_INFO(fss,"Fujitsu Siemens DVB-S rev1.6"); MAKE_AV7110_INFO(gxs_1_3,"Galaxis DVB-S rev1.3"); -static struct pci_device_id pci_tbl[] = { +static const struct pci_device_id pci_tbl[] = { MAKE_EXTENSION_PCI(fsc, 0x110a, 0x), MAKE_EXTENSION_PCI(tts_1_X_fsc, 0x13c2, 0x), MAKE_EXTENSION_PCI(ttt_1_X, 0x13c2, 0x0001), -- 2.7.4
[PATCH 3/9] [media] ttpci: budget-patch: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by and work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/ttpci/budget-patch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/ttpci/budget-patch.c b/drivers/media/pci/ttpci/budget-patch.c index 4429923..a738018 100644 --- a/drivers/media/pci/ttpci/budget-patch.c +++ b/drivers/media/pci/ttpci/budget-patch.c @@ -45,7 +45,7 @@ static struct saa7146_extension budget_extension; MAKE_BUDGET_INFO(ttbp, "TT-Budget/Patch DVB-S 1.x PCI", BUDGET_PATCH); //MAKE_BUDGET_INFO(satel,"TT-Budget/Patch SATELCO PCI", BUDGET_TT_HW_DISEQC); -static struct pci_device_id pci_tbl[] = { +static const struct pci_device_id pci_tbl[] = { MAKE_EXTENSION_PCI(ttbp,0x13c2, 0x), //MAKE_EXTENSION_PCI(satel, 0x13c2, 0x1013), { -- 2.7.4
[PATCH 8/9] [media] saa7146: hexium_orion: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by and work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/saa7146/hexium_orion.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/saa7146/hexium_orion.c b/drivers/media/pci/saa7146/hexium_orion.c index c306a92..01f0158 100644 --- a/drivers/media/pci/saa7146/hexium_orion.c +++ b/drivers/media/pci/saa7146/hexium_orion.c @@ -427,7 +427,7 @@ static struct saa7146_pci_extension_data hexium_orion_4bnc = { .ext = , }; -static struct pci_device_id pci_tbl[] = { +static const struct pci_device_id pci_tbl[] = { { .vendor = PCI_VENDOR_ID_PHILIPS, .device = PCI_DEVICE_ID_PHILIPS_SAA7146, -- 2.7.4
[PATCH 9/9] [media] saa7146: hexium_gemini: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by and work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/saa7146/hexium_gemini.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/saa7146/hexium_gemini.c b/drivers/media/pci/saa7146/hexium_gemini.c index c889ec9..f708cab 100644 --- a/drivers/media/pci/saa7146/hexium_gemini.c +++ b/drivers/media/pci/saa7146/hexium_gemini.c @@ -363,7 +363,7 @@ static struct saa7146_pci_extension_data hexium_gemini_dual_4bnc = { .ext = _extension, }; -static struct pci_device_id pci_tbl[] = { +static const struct pci_device_id pci_tbl[] = { { .vendor = PCI_VENDOR_ID_PHILIPS, .device = PCI_DEVICE_ID_PHILIPS_SAA7146, -- 2.7.4
[PATCH 7/9] [media] saa7146: mxb: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by and work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/saa7146/mxb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/saa7146/mxb.c b/drivers/media/pci/saa7146/mxb.c index 504d788..930218c 100644 --- a/drivers/media/pci/saa7146/mxb.c +++ b/drivers/media/pci/saa7146/mxb.c @@ -819,7 +819,7 @@ static struct saa7146_pci_extension_data mxb = { .ext = , }; -static struct pci_device_id pci_tbl[] = { +static const struct pci_device_id pci_tbl[] = { { .vendor= PCI_VENDOR_ID_PHILIPS, .device= PCI_DEVICE_ID_PHILIPS_SAA7146, -- 2.7.4
[PATCH 09/18] [media] bt8xx: bttv: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/bt8xx/bttv-driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index ed319f1..40110be 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers/media/pci/bt8xx/bttv-driver.c @@ -4388,7 +4388,7 @@ static int bttv_resume(struct pci_dev *pci_dev) } #endif -static struct pci_device_id bttv_pci_tbl[] = { +static const struct pci_device_id bttv_pci_tbl[] = { {PCI_VDEVICE(BROOKTREE, PCI_DEVICE_ID_BT848), 0}, {PCI_VDEVICE(BROOKTREE, PCI_DEVICE_ID_BT849), 0}, {PCI_VDEVICE(BROOKTREE, PCI_DEVICE_ID_BT878), 0}, -- 2.7.4
[PATCH 00/18] constify media pci_device_id
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by work with const pci_device_id. So mark the non-const structs as const. Arvind Yadav (18): [PATCH 01/18] [media] marvell-ccic: constify pci_device_id. [PATCH 02/18] [media] netup_unidvb: constify pci_device_id. [PATCH 03/18] [media] cx23885: constify pci_device_id. [PATCH 04/18] [media] meye: constify pci_device_id. [PATCH 05/18] [media] pluto2: constify pci_device_id. [PATCH 06/18] [media] dm1105: constify pci_device_id. [PATCH 07/18] [media] zoran: constify pci_device_id. [PATCH 08/18] [media] bt8xx: constify pci_device_id. [PATCH 09/18] [media] bt8xx: bttv: constify pci_device_id. [PATCH 10/18] [media] ivtv: constify pci_device_id. [PATCH 11/18] [media] cobalt: constify pci_device_id. [PATCH 12/18] [media] b2c2: constify pci_device_id. [PATCH 13/18] [media] saa7164: constify pci_device_id. [PATCH 14/18] [media] pt1: constify pci_device_id. [PATCH 15/18] [media] mantis: constify pci_device_id. [PATCH 16/18] [media] mantis: hopper_cards: constify pci_device_id. [PATCH 17/18] [media] cx18: constify pci_device_id. [PATCH 18/18] [media] radio: constify pci_device_id. drivers/media/pci/b2c2/flexcop-pci.c | 2 +- drivers/media/pci/bt8xx/bt878.c| 2 +- drivers/media/pci/bt8xx/bttv-driver.c | 2 +- drivers/media/pci/cobalt/cobalt-driver.c | 2 +- drivers/media/pci/cx18/cx18-driver.c | 2 +- drivers/media/pci/cx23885/cx23885-core.c | 2 +- drivers/media/pci/dm1105/dm1105.c | 2 +- drivers/media/pci/ivtv/ivtv-driver.c | 2 +- drivers/media/pci/mantis/hopper_cards.c| 2 +- drivers/media/pci/mantis/mantis_cards.c| 2 +- drivers/media/pci/meye/meye.c | 2 +- drivers/media/pci/netup_unidvb/netup_unidvb_core.c | 2 +- drivers/media/pci/pluto2/pluto2.c | 2 +- drivers/media/pci/pt1/pt1.c| 2 +- drivers/media/pci/saa7164/saa7164-core.c | 2 +- drivers/media/pci/zoran/zoran_card.c | 2 +- drivers/media/platform/marvell-ccic/cafe-driver.c | 2 +- drivers/media/radio/radio-maxiradio.c | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) -- 2.7.4
[PATCH 02/18] [media] netup_unidvb: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/netup_unidvb/netup_unidvb_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c index 5c0a4e6..60e6cd5 100644 --- a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c +++ b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c @@ -1014,7 +1014,7 @@ static void netup_unidvb_finidev(struct pci_dev *pci_dev) } -static struct pci_device_id netup_unidvb_pci_tbl[] = { +static const struct pci_device_id netup_unidvb_pci_tbl[] = { { PCI_DEVICE(0x1b55, 0x18f6) }, /* hw rev. 1.3 */ { PCI_DEVICE(0x1b55, 0x18f7) }, /* hw rev. 1.4 */ { 0, } -- 2.7.4
[PATCH 01/18] [media] marvell-ccic: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/platform/marvell-ccic/cafe-driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/marvell-ccic/cafe-driver.c b/drivers/media/platform/marvell-ccic/cafe-driver.c index 77890bd..b1ad054 100644 --- a/drivers/media/platform/marvell-ccic/cafe-driver.c +++ b/drivers/media/platform/marvell-ccic/cafe-driver.c @@ -612,7 +612,7 @@ static int cafe_pci_resume(struct pci_dev *pdev) #endif /* CONFIG_PM */ -static struct pci_device_id cafe_ids[] = { +static const struct pci_device_id cafe_ids[] = { { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_88ALP01_CCIC) }, { 0, } -- 2.7.4
[PATCH 03/18] [media] cx23885: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/cx23885/cx23885-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/cx23885/cx23885-core.c b/drivers/media/pci/cx23885/cx23885-core.c index 02b5ec5..8f63df1 100644 --- a/drivers/media/pci/cx23885/cx23885-core.c +++ b/drivers/media/pci/cx23885/cx23885-core.c @@ -2056,7 +2056,7 @@ static void cx23885_finidev(struct pci_dev *pci_dev) kfree(dev); } -static struct pci_device_id cx23885_pci_tbl[] = { +static const struct pci_device_id cx23885_pci_tbl[] = { { /* CX23885 */ .vendor = 0x14f1, -- 2.7.4
[PATCH 04/18] [media] meye: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/meye/meye.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/meye/meye.c b/drivers/media/pci/meye/meye.c index 9c4a024..0fe76be 100644 --- a/drivers/media/pci/meye/meye.c +++ b/drivers/media/pci/meye/meye.c @@ -1801,7 +1801,7 @@ static void meye_remove(struct pci_dev *pcidev) printk(KERN_INFO "meye: removed\n"); } -static struct pci_device_id meye_pci_tbl[] = { +static const struct pci_device_id meye_pci_tbl[] = { { PCI_VDEVICE(KAWASAKI, PCI_DEVICE_ID_MCHIP_KL5A72002), 0 }, { } }; -- 2.7.4
[PATCH 05/18] [media] pluto2: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/pluto2/pluto2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/pluto2/pluto2.c b/drivers/media/pci/pluto2/pluto2.c index 7483810..39dcba2 100644 --- a/drivers/media/pci/pluto2/pluto2.c +++ b/drivers/media/pci/pluto2/pluto2.c @@ -770,7 +770,7 @@ static void pluto2_remove(struct pci_dev *pdev) #define PCI_DEVICE_ID_PLUTO2 0x0001 #endif -static struct pci_device_id pluto2_id_table[] = { +static const struct pci_device_id pluto2_id_table[] = { { .vendor = PCI_VENDOR_ID_SCM, .device = PCI_DEVICE_ID_PLUTO2, -- 2.7.4
[PATCH 07/18] [media] zoran: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/zoran/zoran_card.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/zoran/zoran_card.c b/drivers/media/pci/zoran/zoran_card.c index 4680f00..a6b9ebd 100644 --- a/drivers/media/pci/zoran/zoran_card.c +++ b/drivers/media/pci/zoran/zoran_card.c @@ -130,7 +130,7 @@ MODULE_VERSION(ZORAN_VERSION); .vendor = PCI_VENDOR_ID_ZORAN, .device = PCI_DEVICE_ID_ZORAN_36057, \ .subvendor = (subven), .subdevice = (subdev), .driver_data = (data) } -static struct pci_device_id zr36067_pci_tbl[] = { +static const struct pci_device_id zr36067_pci_tbl[] = { ZR_DEVICE(PCI_VENDOR_ID_MIRO, PCI_DEVICE_ID_MIRO_DC10PLUS, DC10plus), ZR_DEVICE(PCI_VENDOR_ID_MIRO, PCI_DEVICE_ID_MIRO_DC30PLUS, DC30plus), ZR_DEVICE(PCI_VENDOR_ID_ELECTRONICDESIGNGMBH, PCI_DEVICE_ID_LML_33R10, LML33R10), -- 2.7.4
[PATCH 06/18] [media] dm1105: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/dm1105/dm1105.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/dm1105/dm1105.c b/drivers/media/pci/dm1105/dm1105.c index 1d41934..0cd854f 100644 --- a/drivers/media/pci/dm1105/dm1105.c +++ b/drivers/media/pci/dm1105/dm1105.c @@ -1208,7 +1208,7 @@ static void dm1105_remove(struct pci_dev *pdev) kfree(dev); } -static struct pci_device_id dm1105_id_table[] = { +static const struct pci_device_id dm1105_id_table[] = { { .vendor = PCI_VENDOR_ID_TRIGEM, .device = PCI_DEVICE_ID_DM1105, -- 2.7.4
[PATCH 12/18] [media] b2c2: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/b2c2/flexcop-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/b2c2/flexcop-pci.c b/drivers/media/pci/b2c2/flexcop-pci.c index 6e60dec..cc6527e 100644 --- a/drivers/media/pci/b2c2/flexcop-pci.c +++ b/drivers/media/pci/b2c2/flexcop-pci.c @@ -415,7 +415,7 @@ static void flexcop_pci_remove(struct pci_dev *pdev) flexcop_device_kfree(fc_pci->fc_dev); } -static struct pci_device_id flexcop_pci_tbl[] = { +static const struct pci_device_id flexcop_pci_tbl[] = { { PCI_DEVICE(0x13d0, 0x2103) }, { }, }; -- 2.7.4
[PATCH 10/18] [media] ivtv: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/ivtv/ivtv-driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c index e8fa99b..54dcac4 100644 --- a/drivers/media/pci/ivtv/ivtv-driver.c +++ b/drivers/media/pci/ivtv/ivtv-driver.c @@ -73,7 +73,7 @@ int (*ivtv_ext_init)(struct ivtv *); EXPORT_SYMBOL(ivtv_ext_init); /* add your revision and whatnot here */ -static struct pci_device_id ivtv_pci_tbl[] = { +static const struct pci_device_id ivtv_pci_tbl[] = { {PCI_VENDOR_ID_ICOMP, PCI_DEVICE_ID_IVTV15, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {PCI_VENDOR_ID_ICOMP, PCI_DEVICE_ID_IVTV16, -- 2.7.4
[PATCH 11/18] [media] cobalt: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/cobalt/cobalt-driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/cobalt/cobalt-driver.c b/drivers/media/pci/cobalt/cobalt-driver.c index f8e173f..98b6cb9 100644 --- a/drivers/media/pci/cobalt/cobalt-driver.c +++ b/drivers/media/pci/cobalt/cobalt-driver.c @@ -36,7 +36,7 @@ #include "cobalt-omnitek.h" /* add your revision and whatnot here */ -static struct pci_device_id cobalt_pci_tbl[] = { +static const struct pci_device_id cobalt_pci_tbl[] = { {PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_COBALT, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {0,} -- 2.7.4
[PATCH 14/18] [media] pt1: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/pt1/pt1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/pt1/pt1.c b/drivers/media/pci/pt1/pt1.c index 3219d2f..b6b1a8d 100644 --- a/drivers/media/pci/pt1/pt1.c +++ b/drivers/media/pci/pt1/pt1.c @@ -1202,7 +1202,7 @@ static int pt1_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } -static struct pci_device_id pt1_id_table[] = { +static const struct pci_device_id pt1_id_table[] = { { PCI_DEVICE(0x10ee, 0x211a) }, { PCI_DEVICE(0x10ee, 0x222a) }, { }, -- 2.7.4
[PATCH 13/18] [media] saa7164: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/saa7164/saa7164-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/saa7164/saa7164-core.c b/drivers/media/pci/saa7164/saa7164-core.c index 75eed4c..fca36a4 100644 --- a/drivers/media/pci/saa7164/saa7164-core.c +++ b/drivers/media/pci/saa7164/saa7164-core.c @@ -1490,7 +1490,7 @@ static void saa7164_finidev(struct pci_dev *pci_dev) kfree(dev); } -static struct pci_device_id saa7164_pci_tbl[] = { +static const struct pci_device_id saa7164_pci_tbl[] = { { /* SAA7164 */ .vendor = 0x1131, -- 2.7.4
[PATCH 15/18] [media] mantis: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/mantis/mantis_cards.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/mantis/mantis_cards.c b/drivers/media/pci/mantis/mantis_cards.c index cdefffc..adc980d 100644 --- a/drivers/media/pci/mantis/mantis_cards.c +++ b/drivers/media/pci/mantis/mantis_cards.c @@ -281,7 +281,7 @@ static void mantis_pci_remove(struct pci_dev *pdev) return; } -static struct pci_device_id mantis_pci_table[] = { +static const struct pci_device_id mantis_pci_table[] = { MAKE_ENTRY(TECHNISAT, CABLESTAR_HD2, _config, RC_MAP_TECHNISAT_TS35), MAKE_ENTRY(TECHNISAT, SKYSTAR_HD2_10, _config, -- 2.7.4
[PATCH 16/18] [media] mantis: hopper_cards: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/mantis/hopper_cards.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/mantis/hopper_cards.c b/drivers/media/pci/mantis/hopper_cards.c index 68b5800..11e9878 100644 --- a/drivers/media/pci/mantis/hopper_cards.c +++ b/drivers/media/pci/mantis/hopper_cards.c @@ -255,7 +255,7 @@ static void hopper_pci_remove(struct pci_dev *pdev) } -static struct pci_device_id hopper_pci_table[] = { +static const struct pci_device_id hopper_pci_table[] = { MAKE_ENTRY(TWINHAN_TECHNOLOGIES, MANTIS_VP_3028_DVB_T, _config, NULL), { } -- 2.7.4
[PATCH 17/18] [media] cx18: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/cx18/cx18-driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c index 8bce49c..8654710 100644 --- a/drivers/media/pci/cx18/cx18-driver.c +++ b/drivers/media/pci/cx18/cx18-driver.c @@ -48,7 +48,7 @@ int (*cx18_ext_init)(struct cx18 *); EXPORT_SYMBOL(cx18_ext_init); /* add your revision and whatnot here */ -static struct pci_device_id cx18_pci_tbl[] = { +static const struct pci_device_id cx18_pci_tbl[] = { {PCI_VENDOR_ID_CX, PCI_DEVICE_ID_CX23418, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {0,} -- 2.7.4
[PATCH 08/18] [media] bt8xx: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/pci/bt8xx/bt878.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/bt8xx/bt878.c b/drivers/media/pci/bt8xx/bt878.c index 8aa7266..a5f5213 100644 --- a/drivers/media/pci/bt8xx/bt878.c +++ b/drivers/media/pci/bt8xx/bt878.c @@ -383,7 +383,7 @@ EXPORT_SYMBOL(bt878_device_control); .driver_data = (unsigned long) name \ } -static struct pci_device_id bt878_pci_tbl[] = { +static const struct pci_device_id bt878_pci_tbl[] = { BROOKTREE_878_DEVICE(0x0071, 0x0101, "Nebula Electronics DigiTV"), BROOKTREE_878_DEVICE(0x1461, 0x0761, "AverMedia AverTV DVB-T 761"), BROOKTREE_878_DEVICE(0x11bd, 0x001c, "Pinnacle PCTV Sat"), -- 2.7.4
[PATCH 18/18] [media] radio: constify pci_device_id.
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/radio/radio-maxiradio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c index 8253f79..3aa5ad3 100644 --- a/drivers/media/radio/radio-maxiradio.c +++ b/drivers/media/radio/radio-maxiradio.c @@ -186,7 +186,7 @@ static void maxiradio_remove(struct pci_dev *pdev) kfree(dev); } -static struct pci_device_id maxiradio_pci_tbl[] = { +static const struct pci_device_id maxiradio_pci_tbl[] = { { PCI_VENDOR_ID_GUILLEMOT, PCI_DEVICE_ID_GUILLEMOT_MAXIRADIO, PCI_ANY_ID, PCI_ANY_ID, }, { 0 } -- 2.7.4
[PATCH] [media] rc: constify attribute_group structures.
attribute_groups are not supposed to change at runtime. All functions working with attribute_groups provided by work with const attribute_group. So mark the non-const structs as const. File size before: textdata bss dec hex filename 11605 880 20 1250530d9 drivers/media/rc/rc-main.o File size After adding 'const': textdata bss dec hex filename 11797 720 20 1253730f9 drivers/media/rc/rc-main.o Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/rc/rc-main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index 6ec7335..61d3e1c 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c @@ -1550,7 +1550,7 @@ static RC_FILTER_ATTR(wakeup_filter_mask, S_IRUGO|S_IWUSR, NULL, }; -static struct attribute_group rc_dev_protocol_attr_grp = { +static const struct attribute_group rc_dev_protocol_attr_grp = { .attrs = rc_dev_protocol_attrs, }; @@ -1560,7 +1560,7 @@ static RC_FILTER_ATTR(wakeup_filter_mask, S_IRUGO|S_IWUSR, NULL, }; -static struct attribute_group rc_dev_filter_attr_grp = { +static const struct attribute_group rc_dev_filter_attr_grp = { .attrs = rc_dev_filter_attrs, }; @@ -1571,7 +1571,7 @@ static RC_FILTER_ATTR(wakeup_filter_mask, S_IRUGO|S_IWUSR, NULL, }; -static struct attribute_group rc_dev_wakeup_filter_attr_grp = { +static const struct attribute_group rc_dev_wakeup_filter_attr_grp = { .attrs = rc_dev_wakeup_filter_attrs, }; -- 1.9.1
[PATCH] [media] imon: constify attribute_group structures.
attribute_groups are not supposed to change at runtime. All functions working with attribute_groups provided by work with const attribute_group. So mark the non-const structs as const. File size before: textdata bss dec hex filename 185512256 77 208845194 drivers/media/rc/imon.o File size After adding 'const': textdata bss dec hex filename 186792160 77 2091651b4 drivers/media/rc/imon.o Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/rc/imon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index 3489010..e9cbfccd 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c @@ -911,7 +911,7 @@ static DEVICE_ATTR(associate_remote, S_IWUSR | S_IRUGO, show_associate_remote, NULL }; -static struct attribute_group imon_display_attr_group = { +static const struct attribute_group imon_display_attr_group = { .attrs = imon_display_sysfs_entries }; @@ -920,7 +920,7 @@ static DEVICE_ATTR(associate_remote, S_IWUSR | S_IRUGO, show_associate_remote, NULL }; -static struct attribute_group imon_rf_attr_group = { +static const struct attribute_group imon_rf_attr_group = { .attrs = imon_rf_sysfs_entries }; -- 1.9.1
[PATCH] staging: atomisp: gc2235: constify acpi_device_id.
acpi_device_id are not supposed to change at runtime. All functions working with acpi_device_id provided by work with const acpi_device_id. So mark the non-const structs as const. File size before: textdata bss dec hex filename 107541360 4 121182f56 drivers/staging/media/atomisp/i2c/gc2235.o File size After adding 'const': textdata bss dec hex filename 108181296 4 121182f56 drivers/staging/media/atomisp/i2c/gc2235.o Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/staging/media/atomisp/i2c/gc2235.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/i2c/gc2235.c b/drivers/staging/media/atomisp/i2c/gc2235.c index 50f4317..48ca23b 100644 --- a/drivers/staging/media/atomisp/i2c/gc2235.c +++ b/drivers/staging/media/atomisp/i2c/gc2235.c @@ -1183,7 +1183,7 @@ static int gc2235_probe(struct i2c_client *client, return ret; } -static struct acpi_device_id gc2235_acpi_match[] = { +static const struct acpi_device_id gc2235_acpi_match[] = { { "INT33F8" }, {}, }; -- 2.7.4
[PATCH] staging: atomisp: mt9m114: constify acpi_device_id.
acpi_device_id are not supposed to change at runtime. All functions working with acpi_device_id provided by work with const acpi_device_id. So mark the non-const structs as const. File size before: textdata bss dec hex filename 151482640 8 177964584 drivers/staging/media/atomisp/i2c/mt9m114.o File size After adding 'const': textdata bss dec hex filename 152442512 8 177644564 drivers/staging/media/atomisp/i2c/mt9m114.o Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/staging/media/atomisp/i2c/mt9m114.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/i2c/mt9m114.c b/drivers/staging/media/atomisp/i2c/mt9m114.c index ced175c..68980ab 100644 --- a/drivers/staging/media/atomisp/i2c/mt9m114.c +++ b/drivers/staging/media/atomisp/i2c/mt9m114.c @@ -1928,7 +1928,7 @@ static int mt9m114_probe(struct i2c_client *client, MODULE_DEVICE_TABLE(i2c, mt9m114_id); -static struct acpi_device_id mt9m114_acpi_match[] = { +static const struct acpi_device_id mt9m114_acpi_match[] = { { "INT33F0" }, { "CRMT1040" }, {}, -- 2.7.4
[PATCH] staging: atomisp: ov5693: constify acpi_device_id.
acpi_device_id are not supposed to change at runtime. All functions working with acpi_device_id provided by work with const acpi_device_id. So mark the non-const structs as const. File size before: textdata bss dec hex filename 207293264 0 239935db9 drivers/staging/media/atomisp/i2c/ov5693/ov5693.o File size After adding 'const': textdata bss dec hex filename 207933200 0 239935db9 drivers/staging/media/atomisp/i2c/ov5693/ov5693.o Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/staging/media/atomisp/i2c/ov5693/ov5693.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/i2c/ov5693/ov5693.c b/drivers/staging/media/atomisp/i2c/ov5693/ov5693.c index 5e9dafe..2c79678 100644 --- a/drivers/staging/media/atomisp/i2c/ov5693/ov5693.c +++ b/drivers/staging/media/atomisp/i2c/ov5693/ov5693.c @@ -2032,7 +2032,7 @@ static int ov5693_probe(struct i2c_client *client, MODULE_DEVICE_TABLE(i2c, ov5693_id); -static struct acpi_device_id ov5693_acpi_match[] = { +static const struct acpi_device_id ov5693_acpi_match[] = { {"INT33BE"}, {}, }; -- 2.7.4
[PATCH] staging: atomisp: ov2722: constify acpi_device_id.
acpi_device_id are not supposed to change at runtime. All functions working with acpi_device_id provided by work with const acpi_device_id. So mark the non-const structs as const. File size before: textdata bss dec hex filename 147711880 0 16651410b drivers/staging/media/atomisp/i2c/ov2722.o File size After adding 'const': textdata bss dec hex filename 148351816 0 16651410b drivers/staging/media/atomisp/i2c/ov2722.o Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/staging/media/atomisp/i2c/ov2722.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/i2c/ov2722.c b/drivers/staging/media/atomisp/i2c/ov2722.c index b7afade..10094ac 100644 --- a/drivers/staging/media/atomisp/i2c/ov2722.c +++ b/drivers/staging/media/atomisp/i2c/ov2722.c @@ -1337,7 +1337,7 @@ static int ov2722_probe(struct i2c_client *client, MODULE_DEVICE_TABLE(i2c, ov2722_id); -static struct acpi_device_id ov2722_acpi_match[] = { +static const struct acpi_device_id ov2722_acpi_match[] = { { "INT33FB" }, {}, }; -- 2.7.4
[PATCH] staging: atomisp: gc0310: constify acpi_device_id.
acpi_device_id are not supposed to change at runtime. All functions working with acpi_device_id provided by work with const acpi_device_id. So mark the non-const structs as const. File size before: textdata bss dec hex filename 102971888 0 121852f99 drivers/staging/media/atomisp/i2c/gc0310.o File size After adding 'const': textdata bss dec hex filename 103611824 0 121852f99 drivers/staging/media/atomisp/i2c/gc0310.o Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/staging/media/atomisp/i2c/gc0310.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/i2c/gc0310.c b/drivers/staging/media/atomisp/i2c/gc0310.c index 1ec616a..c8162bb 100644 --- a/drivers/staging/media/atomisp/i2c/gc0310.c +++ b/drivers/staging/media/atomisp/i2c/gc0310.c @@ -1453,7 +1453,7 @@ static int gc0310_probe(struct i2c_client *client, return ret; } -static struct acpi_device_id gc0310_acpi_match[] = { +static const struct acpi_device_id gc0310_acpi_match[] = { {"XXGC0310"}, {}, }; -- 2.7.4
[PATCH] staging: atomisp: ov8858: constify acpi_device_id.
acpi_device_id are not supposed to change at runtime. All functions working with acpi_device_id provided by work with const acpi_device_id. So mark the non-const structs as const. File size before: textdata bss dec hex filename 238048448 0 322527dfc drivers/staging/media/atomisp/i2c/ov8858.o File size After adding 'const': textdata bss dec hex filename 238688384 0 322527dfc drivers/staging/media/atomisp/i2c/ov8858.o Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/staging/media/atomisp/i2c/ov8858.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/i2c/ov8858.c b/drivers/staging/media/atomisp/i2c/ov8858.c index 9574bc4..43e1638 100644 --- a/drivers/staging/media/atomisp/i2c/ov8858.c +++ b/drivers/staging/media/atomisp/i2c/ov8858.c @@ -2189,7 +2189,7 @@ static const struct i2c_device_id ov8858_id[] = { MODULE_DEVICE_TABLE(i2c, ov8858_id); -static struct acpi_device_id ov8858_acpi_match[] = { +static const struct acpi_device_id ov8858_acpi_match[] = { {"INT3477"}, {}, }; -- 2.7.4
[PATCH] staging: atomisp: ov2680: constify acpi_device_id.
acpi_device_id are not supposed to change at runtime. All functions working with acpi_device_id provided by work with const acpi_device_id. So mark the non-const structs as const. File size before: textdata bss dec hex filename 124663120 8 155943cea drivers/staging/media/atomisp/i2c/ov2680.o File size After adding 'const': textdata bss dec hex filename 125303056 8 155943cea drivers/staging/media/atomisp/i2c/ov2680.o Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/staging/media/atomisp/i2c/ov2680.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/i2c/ov2680.c b/drivers/staging/media/atomisp/i2c/ov2680.c index 5660910..9671876 100644 --- a/drivers/staging/media/atomisp/i2c/ov2680.c +++ b/drivers/staging/media/atomisp/i2c/ov2680.c @@ -1519,7 +1519,7 @@ static int ov2680_probe(struct i2c_client *client, return ret; } -static struct acpi_device_id ov2680_acpi_match[] = { +static const struct acpi_device_id ov2680_acpi_match[] = { {"XXOV2680"}, {}, }; -- 2.7.4
[PATCH] staging: atomisp: lm3554: constify acpi_device_id.
acpi_device_id are not supposed to change at runtime. All functions working with acpi_device_id provided by work with const acpi_device_id. So mark the non-const structs as const. File size before: textdata bss dec hex filename 53471920 2472911c7b drivers/staging/media/atomisp/i2c/lm3554.o File size After adding 'const': textdata bss dec hex filename 54111856 2472911c7b drivers/staging/media/atomisp/i2c/lm3554.o Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/staging/media/atomisp/i2c/lm3554.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/i2c/lm3554.c b/drivers/staging/media/atomisp/i2c/lm3554.c index dd9c9c3..9ba1037 100644 --- a/drivers/staging/media/atomisp/i2c/lm3554.c +++ b/drivers/staging/media/atomisp/i2c/lm3554.c @@ -974,7 +974,7 @@ static const struct dev_pm_ops lm3554_pm_ops = { .resume = lm3554_resume, }; -static struct acpi_device_id lm3554_acpi_match[] = { +static const struct acpi_device_id lm3554_acpi_match[] = { { "INTCF1C" }, {}, }; -- 2.7.4
[PATCH] media: vb2 dma-sg: Constify dma_buf_ops structures.
dma_buf_ops are not supposed to change at runtime. All functions working with dma_buf_ops provided by work with const dma_buf_ops. So mark the non-const structs as const. File size before: textdata bss dec hex filename 5238 112 4535414ea drivers/media/v4l2-core/videobuf2-dma-sg.o File size After adding 'const': textdata bss dec hex filename 5358 0 4536214f2 drivers/media/v4l2-core/videobuf2-dma-sg.o Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/v4l2-core/videobuf2-dma-sg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/videobuf2-dma-sg.c b/drivers/media/v4l2-core/videobuf2-dma-sg.c index 8e8798a..f8b4643 100644 --- a/drivers/media/v4l2-core/videobuf2-dma-sg.c +++ b/drivers/media/v4l2-core/videobuf2-dma-sg.c @@ -500,7 +500,7 @@ static int vb2_dma_sg_dmabuf_ops_mmap(struct dma_buf *dbuf, return vb2_dma_sg_mmap(dbuf->priv, vma); } -static struct dma_buf_ops vb2_dma_sg_dmabuf_ops = { +static const struct dma_buf_ops vb2_dma_sg_dmabuf_ops = { .attach = vb2_dma_sg_dmabuf_ops_attach, .detach = vb2_dma_sg_dmabuf_ops_detach, .map_dma_buf = vb2_dma_sg_dmabuf_ops_map, -- 2.7.4
[PATCH] media: vb2 vmalloc: Constify dma_buf_ops structures.
dma_buf_ops are not supposed to change at runtime. All functions working with dma_buf_ops provided by work with const dma_buf_ops. So mark the non-const structs as const. File size before: textdata bss dec hex filename 3171 192 03363 d23 drivers/media/v4l2-core/videobuf2-vmalloc.o File size After adding 'const': textdata bss dec hex filename 3291 80 03371 d2b drivers/media/v4l2-core/videobuf2-vmalloc.o Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/v4l2-core/videobuf2-vmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/videobuf2-vmalloc.c b/drivers/media/v4l2-core/videobuf2-vmalloc.c index b337d78..6bc130f 100644 --- a/drivers/media/v4l2-core/videobuf2-vmalloc.c +++ b/drivers/media/v4l2-core/videobuf2-vmalloc.c @@ -338,7 +338,7 @@ static int vb2_vmalloc_dmabuf_ops_mmap(struct dma_buf *dbuf, return vb2_vmalloc_mmap(dbuf->priv, vma); } -static struct dma_buf_ops vb2_vmalloc_dmabuf_ops = { +static const struct dma_buf_ops vb2_vmalloc_dmabuf_ops = { .attach = vb2_vmalloc_dmabuf_ops_attach, .detach = vb2_vmalloc_dmabuf_ops_detach, .map_dma_buf = vb2_vmalloc_dmabuf_ops_map, -- 2.7.4
[PATCH] media: vb2 dma-contig: Constify dma_buf_ops structures.
dma_buf_ops are not supposed to change at runtime. All functions working with dma_buf_ops provided by work with const dma_buf_ops. So mark the non-const structs as const. File size before: textdata bss dec hex filename 6035 272 0630718a3 drivers/media/v4l2-core/videobuf2-dma-contig.o File size After adding 'const': textdata bss dec hex filename 6155 160 0631518ab drivers/media/v4l2-core/videobuf2-dma-contig.o Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/v4l2-core/videobuf2-dma-contig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c b/drivers/media/v4l2-core/videobuf2-dma-contig.c index 4f246d1..5b90a66 100644 --- a/drivers/media/v4l2-core/videobuf2-dma-contig.c +++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c @@ -352,7 +352,7 @@ static int vb2_dc_dmabuf_ops_mmap(struct dma_buf *dbuf, return vb2_dc_mmap(dbuf->priv, vma); } -static struct dma_buf_ops vb2_dc_dmabuf_ops = { +static const struct dma_buf_ops vb2_dc_dmabuf_ops = { .attach = vb2_dc_dmabuf_ops_attach, .detach = vb2_dc_dmabuf_ops_detach, .map_dma_buf = vb2_dc_dmabuf_ops_map, -- 2.7.4
[PATCH] media: exynos4-is: fimc-is-i2c: constify dev_pm_ops structures.
dev_pm_ops are not supposed to change at runtime. All functions working with dev_pm_ops provided by work with const dev_pm_ops. So mark the non-const structs as const. File size before: textdata bss dec hex filename 1195 376 01571 623 drivers/media/platform/exynos4-is/fimc-is-i2c.o File size After adding 'const': textdata bss dec hex filename 1403 176 01579 62b drivers/media/platform/exynos4-is/fimc-is-i2c.o Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/platform/exynos4-is/fimc-is-i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/exynos4-is/fimc-is-i2c.c b/drivers/media/platform/exynos4-is/fimc-is-i2c.c index 2f55966..70dd485 100644 --- a/drivers/media/platform/exynos4-is/fimc-is-i2c.c +++ b/drivers/media/platform/exynos4-is/fimc-is-i2c.c @@ -130,7 +130,7 @@ static int fimc_is_i2c_resume(struct device *dev) } #endif -static struct dev_pm_ops fimc_is_i2c_pm_ops = { +static const struct dev_pm_ops fimc_is_i2c_pm_ops = { SET_RUNTIME_PM_OPS(fimc_is_i2c_runtime_suspend, fimc_is_i2c_runtime_resume, NULL) SET_SYSTEM_SLEEP_PM_OPS(fimc_is_i2c_suspend, fimc_is_i2c_resume) -- 1.9.1
[PATCH] Staging: media: davinci_vpfe Fix resource leaks in error paths.
Free memory, if ipipe_s_config and ipipe_g_config are not successful. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/staging/media/davinci_vpfe/dm365_ipipe.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c index 6a3434c..b6994ee 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c +++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c @@ -1286,15 +1286,20 @@ static int ipipe_s_config(struct v4l2_subdev *sd, struct vpfe_ipipe_config *cfg) if (to && from && size) { if (copy_from_user(to, from, size)) { rval = -EFAULT; + kfree(params); break; } rval = module_if->set(ipipe, to); - if (rval) + if (rval) { + kfree(params); goto error; + } } else if (to && !from && size) { rval = module_if->set(ipipe, NULL); - if (rval) + if (rval) { + kfree(params); goto error; + } } kfree(params); } @@ -1328,10 +1333,13 @@ static int ipipe_g_config(struct v4l2_subdev *sd, struct vpfe_ipipe_config *cfg) if (to && from && size) { rval = module_if->get(ipipe, from); - if (rval) + if (rval) { + kfree(params); goto error; + } if (copy_to_user(to, from, size)) { rval = -EFAULT; + kfree(params); break; } } -- 1.9.1
[PATCH] [media] tc358743: Handle return value of clk_prepare_enable
clk_prepare_enable() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/i2c/tc358743.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c index acef4ec..0b30f7b 100644 --- a/drivers/media/i2c/tc358743.c +++ b/drivers/media/i2c/tc358743.c @@ -1730,7 +1730,11 @@ static int tc358743_probe_of(struct tc358743_state *state) state->bus = endpoint->bus.mipi_csi2; - clk_prepare_enable(refclk); + ret = clk_prepare_enable(refclk); + if (ret) { + dev_err(dev, "Failed! to enable clock\n"); + goto free_endpoint; + } state->pdata.refclk_hz = clk_get_rate(refclk); state->pdata.ddc5v_delay = DDC5V_DELAY_100_MS; -- 1.9.1
[PATCH] Staging: media: Unmap and release region obtained by ioremap_nocache
Free memory mapping, if vpfe_ipipe_init is not successful. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/staging/media/davinci_vpfe/dm365_ipipe.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c index ff47a8f3..6a3434c 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c +++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c @@ -1803,14 +1803,14 @@ void vpfe_ipipe_unregister_entities(struct vpfe_ipipe_device *vpfe_ipipe) return -EBUSY; ipipe->base_addr = ioremap_nocache(res->start, res_len); if (!ipipe->base_addr) - return -EBUSY; + goto error_release; res = platform_get_resource(pdev, IORESOURCE_MEM, 6); if (!res) - return -ENOENT; + goto error_unmap; ipipe->isp5_base_addr = ioremap_nocache(res->start, res_len); if (!ipipe->isp5_base_addr) - return -EBUSY; + goto error_unmap; v4l2_subdev_init(sd, _v4l2_ops); sd->internal_ops = _v4l2_internal_ops; @@ -1839,6 +1839,12 @@ void vpfe_ipipe_unregister_entities(struct vpfe_ipipe_device *vpfe_ipipe) sd->ctrl_handler = >ctrls; return media_entity_pads_init(me, IPIPE_PADS_NUM, pads); + +error_unmap: + iounmap(ipipe->base_addr); +error_release: + release_mem_region(res->start, res_len); + return -ENOMEM; } /* -- 1.9.1
[PATCH] media/platform/exynos4-is/fimc-is - Unmap region obtained by of_iomap
Free memory mapping, if fimc_is_probe is not successful. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/media/platform/exynos4-is/fimc-is.c |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/exynos4-is/fimc-is.c b/drivers/media/platform/exynos4-is/fimc-is.c index 32ca55f..10d98a5 100644 --- a/drivers/media/platform/exynos4-is/fimc-is.c +++ b/drivers/media/platform/exynos4-is/fimc-is.c @@ -818,12 +818,13 @@ static int fimc_is_probe(struct platform_device *pdev) is->irq = irq_of_parse_and_map(dev->of_node, 0); if (!is->irq) { dev_err(dev, "no irq found\n"); - return -EINVAL; + ret = -EINVAL; + goto err_iounmap; } ret = fimc_is_get_clocks(is); if (ret < 0) - return ret; + goto err_iounmap; platform_set_drvdata(pdev, is); @@ -877,6 +878,8 @@ err_irq: free_irq(is->irq, is); err_clk: fimc_is_put_clocks(is); +err_iounmap: + iounmap(is->pmu_regs); return ret; } @@ -932,6 +935,7 @@ static int fimc_is_remove(struct platform_device *pdev) fimc_is_unregister_subdevs(is); vb2_dma_contig_clear_max_seg_size(dev); fimc_is_put_clocks(is); + iounmap(is->pmu_regs); fimc_is_debugfs_remove(is); release_firmware(is->fw.f_w); fimc_is_free_cpu_memory(is); -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html