From: Axel Lin <axel.lin@ingics.com>
To: Mark Brown <broonie@kernel.org>
Cc: James Ban <james.ban.opensource@diasemi.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Support Opensource <support.opensource@diasemi.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH] regulator: da9211: Set of_match_table and export device table
Date: Fri, 05 Sep 2014 09:12:55 +0800 [thread overview]
Message-ID: <1409879575.5208.1.camel@phoenix> (raw)
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
next reply other threads:[~2014-09-05 1:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-05 1:12 Axel Lin [this message]
2014-09-05 10:34 ` [PATCH] regulator: da9211: Set of_match_table and export device table 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=1409879575.5208.1.camel@phoenix \
--to=axel.lin@ingics.com \
--cc=broonie@kernel.org \
--cc=james.ban.opensource@diasemi.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=support.opensource@diasemi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.