Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: davinci: make function arguments const

Make the function arguments of functions vpfe_{register/unregister}_ccdc_device
const as the pointer dev does not modify the fields of the structure
it points to. Also, declare the variable ccdc_dev const as it points to the
same structure as dev but it does not modify the fields as well.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

authored by

Bhumika Goyal and committed by
Mauro Carvalho Chehab
1e6be014 1e7126b4

+5 -5
+2 -2
drivers/media/platform/davinci/ccdc_hw_device.h
··· 82 82 }; 83 83 84 84 /* Used by CCDC module to register & unregister with vpfe capture driver */ 85 - int vpfe_register_ccdc_device(struct ccdc_hw_device *dev); 86 - void vpfe_unregister_ccdc_device(struct ccdc_hw_device *dev); 85 + int vpfe_register_ccdc_device(const struct ccdc_hw_device *dev); 86 + void vpfe_unregister_ccdc_device(const struct ccdc_hw_device *dev); 87 87 88 88 #endif 89 89 #endif
+3 -3
drivers/media/platform/davinci/vpfe_capture.c
··· 115 115 }; 116 116 117 117 /* ccdc device registered */ 118 - static struct ccdc_hw_device *ccdc_dev; 118 + static const struct ccdc_hw_device *ccdc_dev; 119 119 /* lock for accessing ccdc information */ 120 120 static DEFINE_MUTEX(ccdc_lock); 121 121 /* ccdc configuration */ ··· 203 203 * vpfe_register_ccdc_device. CCDC module calls this to 204 204 * register with vpfe capture 205 205 */ 206 - int vpfe_register_ccdc_device(struct ccdc_hw_device *dev) 206 + int vpfe_register_ccdc_device(const struct ccdc_hw_device *dev) 207 207 { 208 208 int ret = 0; 209 209 printk(KERN_NOTICE "vpfe_register_ccdc_device: %s\n", dev->name); ··· 259 259 * vpfe_unregister_ccdc_device. CCDC module calls this to 260 260 * unregister with vpfe capture 261 261 */ 262 - void vpfe_unregister_ccdc_device(struct ccdc_hw_device *dev) 262 + void vpfe_unregister_ccdc_device(const struct ccdc_hw_device *dev) 263 263 { 264 264 if (!dev) { 265 265 printk(KERN_ERR "invalid ccdc device ptr\n");