* [PATCH] regulator: da9211: Set of_match_table and export device table
@ 2014-09-05 1:12 Axel Lin
2014-09-05 10:34 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2014-09-05 1:12 UTC (permalink / raw)
To: Mark Brown
Cc: James Ban, Liam Girdwood, Support Opensource,
linux-kernel@vger.kernel.org
Also move da9211_i2c_id and da9211_dt_ids close to the user for better
readability.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/regulator/da9211-regulator.c | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/drivers/regulator/da9211-regulator.c b/drivers/regulator/da9211-regulator.c
index 044c36c..f47adf3 100644
--- a/drivers/regulator/da9211-regulator.c
+++ b/drivers/regulator/da9211-regulator.c
@@ -388,20 +388,6 @@ static int da9211_regulator_init(struct da9211 *chip)
return 0;
}
-static const struct i2c_device_id da9211_i2c_id[] = {
- {"da9211", DA9211},
- {"da9213", DA9213},
- {},
-};
-
-#ifdef CONFIG_OF
-static const struct of_device_id da9211_dt_ids[] = {
- { .compatible = "dlg,da9211", .data = &da9211_i2c_id[0] },
- { .compatible = "dlg,da9213", .data = &da9211_i2c_id[1] },
- {},
-};
-#endif
-
/*
* I2C driver interface functions
*/
@@ -479,12 +465,27 @@ static int da9211_i2c_probe(struct i2c_client *i2c,
return ret;
}
+static const struct i2c_device_id da9211_i2c_id[] = {
+ {"da9211", DA9211},
+ {"da9213", DA9213},
+ {},
+};
MODULE_DEVICE_TABLE(i2c, da9211_i2c_id);
+#ifdef CONFIG_OF
+static const struct of_device_id da9211_dt_ids[] = {
+ { .compatible = "dlg,da9211", .data = &da9211_i2c_id[0] },
+ { .compatible = "dlg,da9213", .data = &da9211_i2c_id[1] },
+ {},
+};
+MODULE_DEVICE_TABLE(of, da9211_dt_ids);
+#endif
+
static struct i2c_driver da9211_regulator_driver = {
.driver = {
.name = "da9211",
.owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(da9211_dt_ids),
},
.probe = da9211_i2c_probe,
.id_table = da9211_i2c_id,
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] regulator: da9211: Set of_match_table and export device table
2014-09-05 1:12 [PATCH] regulator: da9211: Set of_match_table and export device table Axel Lin
@ 2014-09-05 10:34 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2014-09-05 10:34 UTC (permalink / raw)
To: Axel Lin
Cc: James Ban, Liam Girdwood, Support Opensource,
linux-kernel@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 164 bytes --]
On Fri, Sep 05, 2014 at 09:12:55AM +0800, Axel Lin wrote:
> Also move da9211_i2c_id and da9211_dt_ids close to the user for better
> readability.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-05 10:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-05 1:12 [PATCH] regulator: da9211: Set of_match_table and export device table Axel Lin
2014-09-05 10:34 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox