media: vimc: set id_table for platform drivers
authorJavier Martinez Canillas <javierm@redhat.com>
Fri, 14 Jul 2017 08:58:39 +0000 (05:58 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 17 Jul 2017 14:26:56 +0000 (11:26 -0300)
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>
drivers/media/platform/vimc/vimc-capture.c
drivers/media/platform/vimc/vimc-debayer.c
drivers/media/platform/vimc/vimc-scaler.c
drivers/media/platform/vimc/vimc-sensor.c

index 14cb32e211304f834ff24aef76ad40253fbbee43..88a1e5670c725101999be6e99febaff7aebe8770 100644 (file)
@@ -517,21 +517,22 @@ static int vimc_cap_remove(struct platform_device *pdev)
        return 0;
 }
 
+static const struct platform_device_id vimc_cap_driver_ids[] = {
+       {
+               .name           = VIMC_CAP_DRV_NAME,
+       },
+       { }
+};
+
 static struct platform_driver vimc_cap_pdrv = {
        .probe          = vimc_cap_probe,
        .remove         = vimc_cap_remove,
+       .id_table       = vimc_cap_driver_ids,
        .driver         = {
                .name   = VIMC_CAP_DRV_NAME,
        },
 };
 
-static const struct platform_device_id vimc_cap_driver_ids[] = {
-       {
-               .name           = VIMC_CAP_DRV_NAME,
-       },
-       { }
-};
-
 module_platform_driver(vimc_cap_pdrv);
 
 MODULE_DEVICE_TABLE(platform, vimc_cap_driver_ids);
index 35b15bd4d61db32d5263aa21e23c6c863ef01c7a..033a131f67aff124a15fc395a25fcf20d182b3a6 100644 (file)
@@ -577,21 +577,22 @@ static int vimc_deb_remove(struct platform_device *pdev)
        return 0;
 }
 
+static const struct platform_device_id vimc_deb_driver_ids[] = {
+       {
+               .name           = VIMC_DEB_DRV_NAME,
+       },
+       { }
+};
+
 static struct platform_driver vimc_deb_pdrv = {
        .probe          = vimc_deb_probe,
        .remove         = vimc_deb_remove,
+       .id_table       = vimc_deb_driver_ids,
        .driver         = {
                .name   = VIMC_DEB_DRV_NAME,
        },
 };
 
-static const struct platform_device_id vimc_deb_driver_ids[] = {
-       {
-               .name           = VIMC_DEB_DRV_NAME,
-       },
-       { }
-};
-
 module_platform_driver(vimc_deb_pdrv);
 
 MODULE_DEVICE_TABLE(platform, vimc_deb_driver_ids);
index fe77505d2679c1ef0a5af2aba3ef1ecc9884091a..0a3e086e12f32e0474a30c7add7ecc53de76c818 100644 (file)
@@ -431,21 +431,22 @@ static int vimc_sca_remove(struct platform_device *pdev)
        return 0;
 }
 
+static const struct platform_device_id vimc_sca_driver_ids[] = {
+       {
+               .name           = VIMC_SCA_DRV_NAME,
+       },
+       { }
+};
+
 static struct platform_driver vimc_sca_pdrv = {
        .probe          = vimc_sca_probe,
        .remove         = vimc_sca_remove,
+       .id_table       = vimc_sca_driver_ids,
        .driver         = {
                .name   = VIMC_SCA_DRV_NAME,
        },
 };
 
-static const struct platform_device_id vimc_sca_driver_ids[] = {
-       {
-               .name           = VIMC_SCA_DRV_NAME,
-       },
-       { }
-};
-
 module_platform_driver(vimc_sca_pdrv);
 
 MODULE_DEVICE_TABLE(platform, vimc_sca_driver_ids);
index ebdbbe8c05ed53aa4372b1300b044e6d5b25b3d1..615c2b18dcfc87ebd14717001c3af31b7a4c5485 100644 (file)
@@ -365,21 +365,22 @@ static int vimc_sen_remove(struct platform_device *pdev)
        return 0;
 }
 
+static const struct platform_device_id vimc_sen_driver_ids[] = {
+       {
+               .name           = VIMC_SEN_DRV_NAME,
+       },
+       { }
+};
+
 static struct platform_driver vimc_sen_pdrv = {
        .probe          = vimc_sen_probe,
        .remove         = vimc_sen_remove,
+       .id_table       = vimc_sen_driver_ids,
        .driver         = {
                .name   = VIMC_SEN_DRV_NAME,
        },
 };
 
-static const struct platform_device_id vimc_sen_driver_ids[] = {
-       {
-               .name           = VIMC_SEN_DRV_NAME,
-       },
-       { }
-};
-
 module_platform_driver(vimc_sen_pdrv);
 
 MODULE_DEVICE_TABLE(platform, vimc_sen_driver_ids);