From: Linus Walleij <linus.walleij@linaro.org>
To: Jonathan Cameron <jic23@kernel.org>, linux-iio@vger.kernel.org
Cc: Linus Walleij <linus.walleij@linaro.org>
Subject: [PATCH 2/2] iio: light: bh1780: assign a static name
Date: Wed, 25 May 2016 09:40:27 +0200 [thread overview]
Message-ID: <1464162027-24612-2-git-send-email-linus.walleij@linaro.org> (raw)
In-Reply-To: <1464162027-24612-1-git-send-email-linus.walleij@linaro.org>
Using the struct i2c_device->id field for naming the light sensor
is a bad idea: when booting from the pure device tree this is NULL
and that causes the device not to have the "name" property in
sysfs and that in turn confuses the "lsiio" command to stop listing
devices.
So instead of using the device .id, use the hard string "bh1780",
which works just fine.
Fixes: 1f0477f18306 ("iio: light: new driver for the ROHM BH1780")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/iio/light/bh1780.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/light/bh1780.c b/drivers/iio/light/bh1780.c
index 5fd432df2c8f..b54dcba05a82 100644
--- a/drivers/iio/light/bh1780.c
+++ b/drivers/iio/light/bh1780.c
@@ -187,7 +187,7 @@ static int bh1780_probe(struct i2c_client *client,
indio_dev->dev.parent = &client->dev;
indio_dev->info = &bh1780_info;
- indio_dev->name = id->name;
+ indio_dev->name = "bh1780";
indio_dev->channels = bh1780_channels;
indio_dev->num_channels = ARRAY_SIZE(bh1780_channels);
indio_dev->modes = INDIO_DIRECT_MODE;
--
2.4.11
next prev parent reply other threads:[~2016-05-25 7:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-25 7:40 [PATCH 1/2] iio: bh1780: dereference the client properly Linus Walleij
2016-05-25 7:40 ` Linus Walleij [this message]
2016-05-29 18:53 ` [PATCH 2/2] iio: light: bh1780: assign a static name Jonathan Cameron
2016-06-19 11:25 ` Jonathan Cameron
2016-06-19 18:04 ` Linus Walleij
2016-06-19 19:38 ` Jonathan Cameron
2016-05-29 18:52 ` [PATCH 1/2] iio: bh1780: dereference the client properly Jonathan Cameron
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=1464162027-24612-2-git-send-email-linus.walleij@linaro.org \
--to=linus.walleij@linaro.org \
--cc=jic23@kernel.org \
--cc=linux-iio@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;
as well as URLs for NNTP newsgroup(s).