* [PATCH] iio: chemical: ams-iaq-core: update driver name and DT match table
@ 2016-08-02 4:25 Matt Ranostay
2016-08-03 12:13 ` Lars-Peter Clausen
0 siblings, 1 reply; 5+ messages in thread
From: Matt Ranostay @ 2016-08-02 4:25 UTC (permalink / raw)
To: linux-iio; +Cc: jic23, Matt Ranostay
DT match name should be similar to the i2c device table entry, and also
make the iio name match the driver name versus the i2c device location.
Signed-off-by: Matt Ranostay <mranostay@gmail.com>
---
drivers/iio/chemical/ams-iaq-core.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/chemical/ams-iaq-core.c b/drivers/iio/chemical/ams-iaq-core.c
index 41a8e6f2e31d..4c7d1f918d34 100644
--- a/drivers/iio/chemical/ams-iaq-core.c
+++ b/drivers/iio/chemical/ams-iaq-core.c
@@ -27,6 +27,8 @@
#define AMS_IAQCORE_VOC_RESISTANCE_IDX 1
#define AMS_IAQCORE_VOC_TVOC_IDX 2
+#define AMS_IAQCORE_DRVNAME "ams-iaq-core"
+
struct ams_iaqcore_reading {
__be16 co2_ppm;
u8 status;
@@ -164,7 +166,7 @@ static int ams_iaqcore_probe(struct i2c_client *client,
indio_dev->dev.parent = &client->dev;
indio_dev->info = &ams_iaqcore_info,
- indio_dev->name = dev_name(&client->dev);
+ indio_dev->name = AMS_IAQCORE_DRVNAME;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->channels = ams_iaqcore_channels;
@@ -180,14 +182,14 @@ static const struct i2c_device_id ams_iaqcore_id[] = {
MODULE_DEVICE_TABLE(i2c, ams_iaqcore_id);
static const struct of_device_id ams_iaqcore_dt_ids[] = {
- { .compatible = "ams,iaq-core" },
+ { .compatible = "ams,ams-iaq-core" },
{ }
};
MODULE_DEVICE_TABLE(of, ams_iaqcore_dt_ids);
static struct i2c_driver ams_iaqcore_driver = {
.driver = {
- .name = "ams-iaq-core",
+ .name = AMS_IAQCORE_DRVNAME,
.of_match_table = of_match_ptr(ams_iaqcore_dt_ids),
},
.probe = ams_iaqcore_probe,
--
2.7.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] iio: chemical: ams-iaq-core: update driver name and DT match table
2016-08-02 4:25 [PATCH] iio: chemical: ams-iaq-core: update driver name and DT match table Matt Ranostay
@ 2016-08-03 12:13 ` Lars-Peter Clausen
2016-08-03 20:02 ` Matt Ranostay
0 siblings, 1 reply; 5+ messages in thread
From: Lars-Peter Clausen @ 2016-08-03 12:13 UTC (permalink / raw)
To: Matt Ranostay, linux-iio; +Cc: jic23
On 08/02/2016 06:25 AM, Matt Ranostay wrote:
> DT match name should be similar to the i2c device table entry.
Why?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: chemical: ams-iaq-core: update driver name and DT match table
2016-08-03 12:13 ` Lars-Peter Clausen
@ 2016-08-03 20:02 ` Matt Ranostay
2016-08-03 20:08 ` Lars-Peter Clausen
0 siblings, 1 reply; 5+ messages in thread
From: Matt Ranostay @ 2016-08-03 20:02 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: linux-iio@vger.kernel.org, Jonathan Cameron
On Wed, Aug 3, 2016 at 5:13 AM, Lars-Peter Clausen <lars@metafoo.de> wrote:
> On 08/02/2016 06:25 AM, Matt Ranostay wrote:
>> DT match name should be similar to the i2c device table entry.
>
> Why?
To be consistent mostly. But I have noticed compatible =
"ams,iaq-core" doesn't actually match...
Does anyone here know if i2c-core just checks the id_table, and not
of_match_table as well?
Anyone have thoughts on this but I dig into this too deep?
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: chemical: ams-iaq-core: update driver name and DT match table
2016-08-03 20:02 ` Matt Ranostay
@ 2016-08-03 20:08 ` Lars-Peter Clausen
2016-08-04 2:25 ` Matt Ranostay
0 siblings, 1 reply; 5+ messages in thread
From: Lars-Peter Clausen @ 2016-08-03 20:08 UTC (permalink / raw)
To: Matt Ranostay; +Cc: linux-iio@vger.kernel.org, Jonathan Cameron
On 08/03/2016 10:02 PM, Matt Ranostay wrote:
> On Wed, Aug 3, 2016 at 5:13 AM, Lars-Peter Clausen <lars@metafoo.de> wrote:
>> On 08/02/2016 06:25 AM, Matt Ranostay wrote:
>>> DT match name should be similar to the i2c device table entry.
>>
>> Why?
>
> To be consistent mostly. But I have noticed compatible =
> "ams,iaq-core" doesn't actually match...
Well, consistent with what? The normal pattern for devicetree compatible
strings is vendor,partname. So that would suggest that ams,iaq-core is the
preferred solution if it is supposed to be consistent. Btw. there seem to be
no binding documents for this part.
> Does anyone here know if i2c-core just checks the id_table, and not
> of_match_table as well?
>
> Anyone have thoughts on this but I dig into this too deep?
It uses of_match_table when it is set. See
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/i2c/i2c-core.c#n609
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: chemical: ams-iaq-core: update driver name and DT match table
2016-08-03 20:08 ` Lars-Peter Clausen
@ 2016-08-04 2:25 ` Matt Ranostay
0 siblings, 0 replies; 5+ messages in thread
From: Matt Ranostay @ 2016-08-04 2:25 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: linux-iio@vger.kernel.org, Jonathan Cameron
On Wed, Aug 3, 2016 at 1:08 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
> On 08/03/2016 10:02 PM, Matt Ranostay wrote:
>> On Wed, Aug 3, 2016 at 5:13 AM, Lars-Peter Clausen <lars@metafoo.de> wrote:
>>> On 08/02/2016 06:25 AM, Matt Ranostay wrote:
>>>> DT match name should be similar to the i2c device table entry.
>>>
>>> Why?
>>
>> To be consistent mostly. But I have noticed compatible =
>> "ams,iaq-core" doesn't actually match...
>
> Well, consistent with what? The normal pattern for devicetree compatible
> strings is vendor,partname. So that would suggest that ams,iaq-core is the
> preferred solution if it is supposed to be consistent. Btw. there seem to be
> no binding documents for this part.
>
>> Does anyone here know if i2c-core just checks the id_table, and not
>> of_match_table as well?
>>
>> Anyone have thoughts on this but I dig into this too deep?
>
> It uses of_match_table when it is set. See
> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/i2c/i2c-core.c#n609
Yeah thought would enumerate it as well.. but could be that someone
broke something in i2c controller or core. Will test again :)
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-08-04 2:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-02 4:25 [PATCH] iio: chemical: ams-iaq-core: update driver name and DT match table Matt Ranostay
2016-08-03 12:13 ` Lars-Peter Clausen
2016-08-03 20:02 ` Matt Ranostay
2016-08-03 20:08 ` Lars-Peter Clausen
2016-08-04 2:25 ` Matt Ranostay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox