From: Javier Martinez Canillas <javier@osg.samsung.com>
To: linux-kernel@vger.kernel.org
Cc: Mark Brown <broonie@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
Liam Girdwood <lgirdwood@gmail.com>,
linux-mediatek@lists.infradead.org,
John Crispin <blogic@openwrt.org>,
linux-arm-kernel@lists.infradead.org,
Javier Martinez Canillas <javier@osg.samsung.com>
Subject: [PATCH 1/2] regulator: mt6397: Add platform device ID table
Date: Mon, 25 Jan 2016 11:37:15 -0300 [thread overview]
Message-ID: <1453732637-20415-2-git-send-email-javier@osg.samsung.com> (raw)
In-Reply-To: <1453732637-20415-1-git-send-email-javier@osg.samsung.com>
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>
---
drivers/regulator/mt6397-regulator.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/mt6397-regulator.c b/drivers/regulator/mt6397-regulator.c
index a5b2f4762677..585f0399a36b 100644
--- a/drivers/regulator/mt6397-regulator.c
+++ b/drivers/regulator/mt6397-regulator.c
@@ -317,11 +317,18 @@ static int mt6397_regulator_probe(struct platform_device *pdev)
return 0;
}
+static const struct platform_device_id mt6397_platform_ids[] = {
+ {"mt6397-regulator", 0},
+ { /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(platform, mt6397_platform_ids);
+
static struct platform_driver mt6397_regulator_driver = {
.driver = {
.name = "mt6397-regulator",
},
.probe = mt6397_regulator_probe,
+ .id_table = mt6397_platform_ids,
};
module_platform_driver(mt6397_regulator_driver);
@@ -329,4 +336,3 @@ module_platform_driver(mt6397_regulator_driver);
MODULE_AUTHOR("Flora Fu <flora.fu@mediatek.com>");
MODULE_DESCRIPTION("Regulator Driver for MediaTek MT6397 PMIC");
MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:mt6397-regulator");
--
2.5.0
next prev parent reply other threads:[~2016-01-25 14:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-25 14:37 [PATCH 0/2] regulator: mt6397: Add platform and OF tables and fix module autoload Javier Martinez Canillas
2016-01-25 14:37 ` Javier Martinez Canillas [this message]
2016-01-27 18:38 ` Applied "regulator: mt6397: Add platform device ID table" to the regulator tree Mark Brown
2016-01-25 14:37 ` [PATCH 2/2] regulator: mt6397: Add OF match table Javier Martinez Canillas
2016-01-27 18:38 ` Applied "regulator: mt6397: Add OF match table" to the regulator tree Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1453732637-20415-2-git-send-email-javier@osg.samsung.com \
--to=javier@osg.samsung.com \
--cc=blogic@openwrt.org \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®