From: Javier Martinez Canillas <javier@osg.samsung.com>
To: linux-kernel@vger.kernel.org
Cc: Javier Martinez Canillas <javier@osg.samsung.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Arnd Bergmann <arnd@arndb.de>
Subject: [PATCH 1/4] misc: tsl2550: Add OF device ID table
Date: Tue, 14 Mar 2017 12:16:35 -0300 [thread overview]
Message-ID: <20170314151638.23132-2-javier@osg.samsung.com> (raw)
In-Reply-To: <20170314151638.23132-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/misc/tsl2550.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/misc/tsl2550.c b/drivers/misc/tsl2550.c
index 87a13374fdc0..9e7d01c68c68 100644
--- a/drivers/misc/tsl2550.c
+++ b/drivers/misc/tsl2550.c
@@ -443,9 +443,16 @@ static const struct i2c_device_id tsl2550_id[] = {
};
MODULE_DEVICE_TABLE(i2c, tsl2550_id);
+static const struct of_device_id tsl2550_of_match[] = {
+ { .compatible = "taos,tsl2550" },
+ { }
+};
+MODULE_DEVICE_TABLE(of, tsl2550_of_match);
+
static struct i2c_driver tsl2550_driver = {
.driver = {
.name = TSL2550_DRV_NAME,
+ .of_match_table = of_match_ptr(tsl2550_of_match),
.pm = TSL2550_PM_OPS,
},
.probe = tsl2550_probe,
--
2.9.3
next prev parent reply other threads:[~2017-03-14 15:17 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-14 15:16 [PATCH 0/4] misc: Add OF device table to I2C drivers that are missing it Javier Martinez Canillas
2017-03-14 15:16 ` Javier Martinez Canillas [this message]
2017-03-14 20:53 ` [PATCH 1/4] misc: tsl2550: Add OF device ID table Arnd Bergmann
2017-03-14 15:16 ` [PATCH 2/4] misc: ds1682: " Javier Martinez Canillas
2017-03-14 20:46 ` Arnd Bergmann
2017-03-15 0:38 ` Javier Martinez Canillas
2017-03-15 3:26 ` Javier Martinez Canillas
2017-03-14 15:16 ` [PATCH 3/4] eeprom: idt_89hpesx: " Javier Martinez Canillas
2017-03-14 15:16 ` [PATCH 4/4] eeprom: at24: " Javier Martinez Canillas
2017-03-14 22:59 ` Andy Shevchenko
2017-03-15 0:15 ` Javier Martinez Canillas
2017-03-15 7:58 ` Wolfram Sang
2017-03-15 10:58 ` Javier Martinez Canillas
2017-03-15 11:21 ` Andy Shevchenko
2017-03-15 11:39 ` Javier Martinez Canillas
2017-03-15 22:43 ` Andy Shevchenko
2017-03-16 12:28 ` Javier Martinez Canillas
2017-03-16 13:07 ` Wolfram Sang
2017-03-16 13:13 ` Javier Martinez Canillas
2017-03-16 13:36 ` Wolfram Sang
2017-03-16 14:07 ` Javier Martinez Canillas
2017-03-16 15:05 ` Wolfram Sang
2017-03-16 15:39 ` Javier Martinez Canillas
2017-03-20 16:45 ` Javier Martinez Canillas
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=20170314151638.23132-2-javier@osg.samsung.com \
--to=javier@osg.samsung.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/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®