aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Martinez Canillas <javier@osg.samsung.com>2017-03-03 09:29:21 -0500
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>2017-03-08 19:29:29 -0500
commit21f274327080271dc5adb7ae9852ffa5e028ce55 (patch)
treedcb599eaa828b959058f8ff4af36ca4809b20dbe
parent0383550402352c0036129524f751d8182e837960 (diff)
rtc: s35390a: Add OF device ID table
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> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
-rw-r--r--drivers/rtc/rtc-s35390a.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-s35390a.c b/drivers/rtc/rtc-s35390a.c
index 5dab4665ca3b..449820eeefe8 100644
--- a/drivers/rtc/rtc-s35390a.c
+++ b/drivers/rtc/rtc-s35390a.c
@@ -58,6 +58,13 @@ static const struct i2c_device_id s35390a_id[] = {
58}; 58};
59MODULE_DEVICE_TABLE(i2c, s35390a_id); 59MODULE_DEVICE_TABLE(i2c, s35390a_id);
60 60
61static const struct of_device_id s35390a_of_match[] = {
62 { .compatible = "s35390a" },
63 { .compatible = "sii,s35390a" },
64 { }
65};
66MODULE_DEVICE_TABLE(of, s35390a_of_match);
67
61struct s35390a { 68struct s35390a {
62 struct i2c_client *client[8]; 69 struct i2c_client *client[8];
63 struct rtc_device *rtc; 70 struct rtc_device *rtc;
@@ -502,6 +509,7 @@ static int s35390a_remove(struct i2c_client *client)
502static struct i2c_driver s35390a_driver = { 509static struct i2c_driver s35390a_driver = {
503 .driver = { 510 .driver = {
504 .name = "rtc-s35390a", 511 .name = "rtc-s35390a",
512 .of_match_table = of_match_ptr(s35390a_of_match),
505 }, 513 },
506 .probe = s35390a_probe, 514 .probe = s35390a_probe,
507 .remove = s35390a_remove, 515 .remove = s35390a_remove,