Commit e1d9a109 authored by Javier Martinez Canillas's avatar Javier Martinez Canillas Committed by Lee Jones

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: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 0e5df61d
...@@ -326,6 +326,12 @@ static const struct of_device_id mt6397_of_match[] = { ...@@ -326,6 +326,12 @@ static const struct of_device_id mt6397_of_match[] = {
}; };
MODULE_DEVICE_TABLE(of, mt6397_of_match); MODULE_DEVICE_TABLE(of, mt6397_of_match);
static const struct platform_device_id mt6397_id[] = {
{ "mt6397", 0 },
{ },
};
MODULE_DEVICE_TABLE(platform, mt6397_id);
static struct platform_driver mt6397_driver = { static struct platform_driver mt6397_driver = {
.probe = mt6397_probe, .probe = mt6397_probe,
.remove = mt6397_remove, .remove = mt6397_remove,
...@@ -334,6 +340,7 @@ static struct platform_driver mt6397_driver = { ...@@ -334,6 +340,7 @@ static struct platform_driver mt6397_driver = {
.of_match_table = of_match_ptr(mt6397_of_match), .of_match_table = of_match_ptr(mt6397_of_match),
.pm = &mt6397_pm_ops, .pm = &mt6397_pm_ops,
}, },
.id_table = mt6397_id,
}; };
module_platform_driver(mt6397_driver); module_platform_driver(mt6397_driver);
...@@ -341,4 +348,3 @@ module_platform_driver(mt6397_driver); ...@@ -341,4 +348,3 @@ module_platform_driver(mt6397_driver);
MODULE_AUTHOR("Flora Fu, MediaTek"); MODULE_AUTHOR("Flora Fu, MediaTek");
MODULE_DESCRIPTION("Driver for MediaTek MT6397 PMIC"); MODULE_DESCRIPTION("Driver for MediaTek MT6397 PMIC");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:mt6397");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment