Commit 0dd09ca4 authored by Linus Walleij's avatar Linus Walleij Committed by Jonathan Cameron

iio: light: bh1780: assign a static name

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: 1f0477f1 ("iio: light: new driver for the ROHM BH1780")
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Cc: <Stable@vger.kernel.org>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 13c27e94
...@@ -187,7 +187,7 @@ static int bh1780_probe(struct i2c_client *client, ...@@ -187,7 +187,7 @@ static int bh1780_probe(struct i2c_client *client,
indio_dev->dev.parent = &client->dev; indio_dev->dev.parent = &client->dev;
indio_dev->info = &bh1780_info; indio_dev->info = &bh1780_info;
indio_dev->name = id->name; indio_dev->name = "bh1780";
indio_dev->channels = bh1780_channels; indio_dev->channels = bh1780_channels;
indio_dev->num_channels = ARRAY_SIZE(bh1780_channels); indio_dev->num_channels = ARRAY_SIZE(bh1780_channels);
indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->modes = INDIO_DIRECT_MODE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment