aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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
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')
-rw-r--r--drivers/media/platform/vimc/vimc-capture.c15
-rw-r--r--drivers/media/platform/vimc/vimc-debayer.c15
-rw-r--r--drivers/media/platform/vimc/vimc-scaler.c15
-rw-r--r--drivers/media/platform/vimc/vimc-sensor.c15
4 files changed, 32 insertions, 28 deletions
diff --git a/drivers/media/platform/vimc/vimc-capture.c b/drivers/media/platform/vimc/vimc-capture.c
index 14cb32e21130..88a1e5670c72 100644
--- a/drivers/media/platform/vimc/vimc-capture.c
+++ b/drivers/media/platform/vimc/vimc-capture.c
@@ -517,21 +517,22 @@ static int vimc_cap_remove(struct platform_device *pdev)
517 return 0; 517 return 0;
518} 518}
519 519
520static const struct platform_device_id vimc_cap_driver_ids[] = {
521 {
522 .name = VIMC_CAP_DRV_NAME,
523 },
524 { }
525};
526
520static struct platform_driver vimc_cap_pdrv = { 527static struct platform_driver vimc_cap_pdrv = {
521 .probe = vimc_cap_probe, 528 .probe = vimc_cap_probe,
522 .remove = vimc_cap_remove, 529 .remove = vimc_cap_remove,
530 .id_table = vimc_cap_driver_ids,
523 .driver = { 531 .driver = {
524 .name = VIMC_CAP_DRV_NAME, 532 .name = VIMC_CAP_DRV_NAME,
525 }, 533 },
526}; 534};
527 535
528static const struct platform_device_id vimc_cap_driver_ids[] = {
529 {
530 .name = VIMC_CAP_DRV_NAME,
531 },
532 { }
533};
534
535module_platform_driver(vimc_cap_pdrv); 536module_platform_driver(vimc_cap_pdrv);
536 537
537MODULE_DEVICE_TABLE(platform, vimc_cap_driver_ids); 538MODULE_DEVICE_TABLE(platform, vimc_cap_driver_ids);
diff --git a/drivers/media/platform/vimc/vimc-debayer.c b/drivers/media/platform/vimc/vimc-debayer.c
index 35b15bd4d61d..033a131f67af 100644
--- a/drivers/media/platform/vimc/vimc-debayer.c
+++ b/drivers/media/platform/vimc/vimc-debayer.c
@@ -577,21 +577,22 @@ static int vimc_deb_remove(struct platform_device *pdev)
577 return 0; 577 return 0;
578} 578}
579 579
580static const struct platform_device_id vimc_deb_driver_ids[] = {
581 {
582 .name = VIMC_DEB_DRV_NAME,
583 },
584 { }
585};
586
580static struct platform_driver vimc_deb_pdrv = { 587static struct platform_driver vimc_deb_pdrv = {
581 .probe = vimc_deb_probe, 588 .probe = vimc_deb_probe,
582 .remove = vimc_deb_remove, 589 .remove = vimc_deb_remove,
590 .id_table = vimc_deb_driver_ids,
583 .driver = { 591 .driver = {
584 .name = VIMC_DEB_DRV_NAME, 592 .name = VIMC_DEB_DRV_NAME,
585 }, 593 },
586}; 594};
587 595
588static const struct platform_device_id vimc_deb_driver_ids[] = {
589 {
590 .name = VIMC_DEB_DRV_NAME,
591 },
592 { }
593};
594
595module_platform_driver(vimc_deb_pdrv); 596module_platform_driver(vimc_deb_pdrv);
596 597
597MODULE_DEVICE_TABLE(platform, vimc_deb_driver_ids); 598MODULE_DEVICE_TABLE(platform, vimc_deb_driver_ids);
diff --git a/drivers/media/platform/vimc/vimc-scaler.c b/drivers/media/platform/vimc/vimc-scaler.c
index fe77505d2679..0a3e086e12f3 100644
--- a/drivers/media/platform/vimc/vimc-scaler.c
+++ b/drivers/media/platform/vimc/vimc-scaler.c
@@ -431,21 +431,22 @@ static int vimc_sca_remove(struct platform_device *pdev)
431 return 0; 431 return 0;
432} 432}
433 433
434static const struct platform_device_id vimc_sca_driver_ids[] = {
435 {
436 .name = VIMC_SCA_DRV_NAME,
437 },
438 { }
439};
440
434static struct platform_driver vimc_sca_pdrv = { 441static struct platform_driver vimc_sca_pdrv = {
435 .probe = vimc_sca_probe, 442 .probe = vimc_sca_probe,
436 .remove = vimc_sca_remove, 443 .remove = vimc_sca_remove,
444 .id_table = vimc_sca_driver_ids,
437 .driver = { 445 .driver = {
438 .name = VIMC_SCA_DRV_NAME, 446 .name = VIMC_SCA_DRV_NAME,
439 }, 447 },
440}; 448};
441 449
442static const struct platform_device_id vimc_sca_driver_ids[] = {
443 {
444 .name = VIMC_SCA_DRV_NAME,
445 },
446 { }
447};
448
449module_platform_driver(vimc_sca_pdrv); 450module_platform_driver(vimc_sca_pdrv);
450 451
451MODULE_DEVICE_TABLE(platform, vimc_sca_driver_ids); 452MODULE_DEVICE_TABLE(platform, vimc_sca_driver_ids);
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);