aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/vimc/vimc-sensor.c
diff options
context:
space:
mode:
authorJavier Martinez Canillas <javierm@redhat.com>2017-07-14 04:58:39 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-07-17 10:26:56 -0400
commitbb3abbb74efd22768590f88aa9eea0ae191efb53 (patch)
treeabe1c983e764b183ae8ab0528a74c67302e9558b /drivers/media/platform/vimc/vimc-sensor.c
parenta1a0a56ffc0f587161a4e2830c4afa690e497730 (diff)
media: vimc: set id_table for platform drivers
The vimc platform drivers define a platform device ID table but these are not set to the .id_table field in the platform driver structure. So the platform device ID table is only used to fill the aliases in the module but are not used for matching (works because the platform subsystem fallbacks to the driver's name if no .id_table is set). But this also means that the platform device ID table isn't used if the driver is built-in, which leads to the following build warning: This causes the following build warnings when the driver is built-in: drivers/media/platform/vimc//vimc-capture.c:528:40: warning: ‘vimc_cap_driver_ids’ defined but not used [-Wunused-const-variable=] static const struct platform_device_id vimc_cap_driver_ids[] = { ^~~~~~~~~~~~~~~~~~~ drivers/media/platform/vimc//vimc-debayer.c:588:40: warning: ‘vimc_deb_driver_ids’ defined but not used [-Wunused-const-variable=] static const struct platform_device_id vimc_deb_driver_ids[] = { ^~~~~~~~~~~~~~~~~~~ drivers/media/platform/vimc//vimc-scaler.c:442:40: warning: ‘vimc_sca_driver_ids’ defined but not used [-Wunused-const-variable=] static const struct platform_device_id vimc_sca_driver_ids[] = { ^~~~~~~~~~~~~~~~~~~ drivers/media/platform/vimc//vimc-sensor.c:376:40: warning: ‘vimc_sen_driver_ids’ defined but not used [-Wunused-const-variable=] static const struct platform_device_id vimc_sen_driver_ids[] = { ^~~~~~~~~~~~~~~~~~~ Reported-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Suggested-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Helen Koike <helen.koike@collabora.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Diffstat (limited to 'drivers/media/platform/vimc/vimc-sensor.c')
-rw-r--r--drivers/media/platform/vimc/vimc-sensor.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/media/platform/vimc/vimc-sensor.c b/drivers/media/platform/vimc/vimc-sensor.c
index ebdbbe8c05ed..615c2b18dcfc 100644
--- a/drivers/media/platform/vimc/vimc-sensor.c
+++ b/drivers/media/platform/vimc/vimc-sensor.c
@@ -365,21 +365,22 @@ static int vimc_sen_remove(struct platform_device *pdev)
365 return 0; 365 return 0;
366} 366}
367 367
368static const struct platform_device_id vimc_sen_driver_ids[] = {
369 {
370 .name = VIMC_SEN_DRV_NAME,
371 },
372 { }
373};
374
368static struct platform_driver vimc_sen_pdrv = { 375static struct platform_driver vimc_sen_pdrv = {
369 .probe = vimc_sen_probe, 376 .probe = vimc_sen_probe,
370 .remove = vimc_sen_remove, 377 .remove = vimc_sen_remove,
378 .id_table = vimc_sen_driver_ids,
371 .driver = { 379 .driver = {
372 .name = VIMC_SEN_DRV_NAME, 380 .name = VIMC_SEN_DRV_NAME,
373 }, 381 },
374}; 382};
375 383
376static const struct platform_device_id vimc_sen_driver_ids[] = {
377 {
378 .name = VIMC_SEN_DRV_NAME,
379 },
380 { }
381};
382
383module_platform_driver(vimc_sen_pdrv); 384module_platform_driver(vimc_sen_pdrv);
384 385
385MODULE_DEVICE_TABLE(platform, vimc_sen_driver_ids); 386MODULE_DEVICE_TABLE(platform, vimc_sen_driver_ids);