From: Javier Martinez Canillas <javier@osg.samsung.com>
To: linux-kernel@vger.kernel.org
Cc: Javier Martinez Canillas <javier@osg.samsung.com>,
Alexandre Belloni <alexandre.belloni@free-electrons.com>,
rtc-linux@googlegroups.com,
Alessandro Zummo <a.zummo@towertech.it>
Subject: [PATCH 06/13] rtc: ds3232: Add OF device ID table
Date: Fri, 3 Mar 2017 11:29:17 -0300 [thread overview]
Message-ID: <20170303142925.17915-7-javier@osg.samsung.com> (raw)
In-Reply-To: <20170303142925.17915-1-javier@osg.samsung.com>
The driver doesn't have a struct of_device_id table but supported devices
are registered via Device Trees. This is working on the assumption that a
I2C device registered via OF will always match a legacy I2C device ID and
that the MODALIAS reported will always be of the form i2c:<device>.
But this could change in the future so the correct approach is to have an
OF device ID table if the devices are registered via OF.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---
drivers/rtc/rtc-ds3232.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/rtc/rtc-ds3232.c b/drivers/rtc/rtc-ds3232.c
index 9bb39a06b994..deff431a37c4 100644
--- a/drivers/rtc/rtc-ds3232.c
+++ b/drivers/rtc/rtc-ds3232.c
@@ -442,9 +442,16 @@ static const struct i2c_device_id ds3232_id[] = {
};
MODULE_DEVICE_TABLE(i2c, ds3232_id);
+static const struct of_device_id ds3232_of_match[] = {
+ { .compatible = "dallas,ds3232" },
+ { }
+};
+MODULE_DEVICE_TABLE(of, ds3232_of_match);
+
static struct i2c_driver ds3232_driver = {
.driver = {
.name = "rtc-ds3232",
+ .of_match_table = of_match_ptr(ds3232_of_match),
.pm = &ds3232_pm_ops,
},
.probe = ds3232_i2c_probe,
--
2.9.3
next prev parent reply other threads:[~2017-03-03 14:29 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-03 14:29 [PATCH 00/13] rtc: Add OF device table to I2C drivers that are missing it Javier Martinez Canillas
2017-03-03 14:29 ` [PATCH 01/13] rtc: rv8803: Add OF device ID table Javier Martinez Canillas
2017-03-03 14:29 ` [PATCH 02/13] rtc: rv3029: " Javier Martinez Canillas
2017-03-03 14:29 ` [PATCH 03/13] rtc: bq32k: " Javier Martinez Canillas
2017-03-03 14:29 ` [PATCH 04/13] rtc: ds1307: " Javier Martinez Canillas
2017-03-03 14:29 ` [PATCH 05/13] rtc: rx8010: " Javier Martinez Canillas
2017-03-03 14:29 ` Javier Martinez Canillas [this message]
2017-03-03 14:29 ` [PATCH 07/13] rtc: rtc-ds1672: " Javier Martinez Canillas
2017-03-03 14:29 ` [PATCH 08/13] rtc: ds1374: Set .of_match_table to " Javier Martinez Canillas
2017-03-03 14:29 ` [PATCH 09/13] rtc: isl1208: Add " Javier Martinez Canillas
2017-03-03 14:29 ` [PATCH 10/13] rtc: s35390a: " Javier Martinez Canillas
2017-03-03 14:29 ` [PATCH 11/13] rtc: rx8581: " Javier Martinez Canillas
2017-03-03 14:29 ` [PATCH 12/13] rtc: m41t80: " Javier Martinez Canillas
2017-03-03 14:29 ` [PATCH 13/13] rtc: rs5c372: " Javier Martinez Canillas
2017-03-03 15:01 ` [PATCH 00/13] rtc: Add OF device table to I2C drivers that are missing it Alexandre Belloni
2017-03-03 15:27 ` Javier Martinez Canillas
2017-03-03 16:04 ` Alexandre Belloni
2017-03-03 17:08 ` Javier Martinez Canillas
2017-03-09 0:30 ` Alexandre Belloni
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=20170303142925.17915-7-javier@osg.samsung.com \
--to=javier@osg.samsung.com \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@free-electrons.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rtc-linux@googlegroups.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®