aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Martinez Canillas <javier@osg.samsung.com>2016-02-10 11:50:18 -0500
committerLee Jones <lee.jones@linaro.org>2016-03-16 04:50:32 -0400
commite1d9a10918396ae26dd5181d454c793ff17c9ded (patch)
treeb2e722fdc0b4a3ae1b4df7111be5b271c22a7d9d
parent0e5df61d26f2ad609eb5a699b9ab587564ccd65f (diff)
mfd: mt6397: Add platform device ID table
The platform bus_type .match callback attempts to match the platform device name with an entry on the .id_table if provided and fallbacks to match with the driver's name if a table is not provided. Using a platform device ID to match is more explicit, allows the driver to support more than one device and also the MODULE_DEVICE_TABLE macro can be used to export the module aliases information instead of the MODULE_ALIAS. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
-rw-r--r--drivers/mfd/mt6397-core.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c
index 8234cd34e438..8e8d93249c09 100644
--- a/drivers/mfd/mt6397-core.c
+++ b/drivers/mfd/mt6397-core.c
@@ -326,6 +326,12 @@ static const struct of_device_id mt6397_of_match[] = {
326}; 326};
327MODULE_DEVICE_TABLE(of, mt6397_of_match); 327MODULE_DEVICE_TABLE(of, mt6397_of_match);
328 328
329static const struct platform_device_id mt6397_id[] = {
330 { "mt6397", 0 },
331 { },
332};
333MODULE_DEVICE_TABLE(platform, mt6397_id);
334
329static struct platform_driver mt6397_driver = { 335static struct platform_driver mt6397_driver = {
330 .probe = mt6397_probe, 336 .probe = mt6397_probe,
331 .remove = mt6397_remove, 337 .remove = mt6397_remove,
@@ -334,6 +340,7 @@ static struct platform_driver mt6397_driver = {
334 .of_match_table = of_match_ptr(mt6397_of_match), 340 .of_match_table = of_match_ptr(mt6397_of_match),
335 .pm = &mt6397_pm_ops, 341 .pm = &mt6397_pm_ops,
336 }, 342 },
343 .id_table = mt6397_id,
337}; 344};
338 345
339module_platform_driver(mt6397_driver); 346module_platform_driver(mt6397_driver);
@@ -341,4 +348,3 @@ module_platform_driver(mt6397_driver);
341MODULE_AUTHOR("Flora Fu, MediaTek"); 348MODULE_AUTHOR("Flora Fu, MediaTek");
342MODULE_DESCRIPTION("Driver for MediaTek MT6397 PMIC"); 349MODULE_DESCRIPTION("Driver for MediaTek MT6397 PMIC");
343MODULE_LICENSE("GPL"); 350MODULE_LICENSE("GPL");
344MODULE_ALIAS("platform:mt6397");