Commit 85a6b728 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Jonathan Cameron

iio: light: tsl2563: Utilise temporary variable for struct device

We have a temporary variable to keep pointer to struct device.
Utilise it inside the ->probe() implementation.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: default avatarFerry Toth <ftoth@exalondelft.nl>
Link: https://lore.kernel.org/r/20221207190348.9347-8-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 1f5e408f
...@@ -701,7 +701,7 @@ static int tsl2563_probe(struct i2c_client *client) ...@@ -701,7 +701,7 @@ static int tsl2563_probe(struct i2c_client *client)
u8 id = 0; u8 id = 0;
int err; int err;
indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*chip)); indio_dev = devm_iio_device_alloc(dev, sizeof(*chip));
if (!indio_dev) if (!indio_dev)
return -ENOMEM; return -ENOMEM;
...@@ -731,7 +731,7 @@ static int tsl2563_probe(struct i2c_client *client) ...@@ -731,7 +731,7 @@ static int tsl2563_probe(struct i2c_client *client)
chip->cover_comp_gain = 1; chip->cover_comp_gain = 1;
device_property_read_u32(dev, "amstaos,cover-comp-gain", &chip->cover_comp_gain); device_property_read_u32(dev, "amstaos,cover-comp-gain", &chip->cover_comp_gain);
dev_info(&client->dev, "model %d, rev. %d\n", id >> 4, id & 0x0f); dev_info(dev, "model %d, rev. %d\n", id >> 4, id & 0x0f);
indio_dev->name = client->name; indio_dev->name = client->name;
indio_dev->channels = tsl2563_channels; indio_dev->channels = tsl2563_channels;
indio_dev->num_channels = ARRAY_SIZE(tsl2563_channels); indio_dev->num_channels = ARRAY_SIZE(tsl2563_channels);
...@@ -748,7 +748,7 @@ static int tsl2563_probe(struct i2c_client *client) ...@@ -748,7 +748,7 @@ static int tsl2563_probe(struct i2c_client *client)
irq_flags = IRQF_TRIGGER_RISING; irq_flags = IRQF_TRIGGER_RISING;
irq_flags |= IRQF_ONESHOT; irq_flags |= IRQF_ONESHOT;
err = devm_request_threaded_irq(&client->dev, client->irq, err = devm_request_threaded_irq(dev, client->irq,
NULL, NULL,
&tsl2563_event_handler, &tsl2563_event_handler,
irq_flags, irq_flags,
......
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