summaryrefslogtreecommitdiff
path: root/drivers/iio
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2021-03-17 10:40:11 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-03-25 22:13:52 +0300
commitddaf14dab78c915b52f6c359b3f00ef3b97bccf6 (patch)
treeb9c1ad28b8389cae558a69f811516e562322f18e /drivers/iio
parentdbd7e992a55dd5c9b3e0771b2c417187c5de059e (diff)
downloadlinux-ddaf14dab78c915b52f6c359b3f00ef3b97bccf6.tar.xz
iio: acpi_als: Add local variable dev in probe
Use dev = &device->dev in probe routine for clarity. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210317074012.2336454-3-gwendal@chromium.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/light/acpi-als.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/iio/light/acpi-als.c b/drivers/iio/light/acpi-als.c
index 784868aa8fbf..a2107945cff9 100644
--- a/drivers/iio/light/acpi-als.c
+++ b/drivers/iio/light/acpi-als.c
@@ -161,11 +161,12 @@ static const struct iio_info acpi_als_info = {
static int acpi_als_add(struct acpi_device *device)
{
- struct acpi_als *als;
+ struct device *dev = &device->dev;
struct iio_dev *indio_dev;
+ struct acpi_als *als;
int ret;
- indio_dev = devm_iio_device_alloc(&device->dev, sizeof(*als));
+ indio_dev = devm_iio_device_alloc(dev, sizeof(*als));
if (!indio_dev)
return -ENOMEM;
@@ -180,12 +181,12 @@ static int acpi_als_add(struct acpi_device *device)
indio_dev->channels = acpi_als_channels;
indio_dev->num_channels = ARRAY_SIZE(acpi_als_channels);
- ret = devm_iio_kfifo_buffer_setup(&device->dev, indio_dev,
+ ret = devm_iio_kfifo_buffer_setup(dev, indio_dev,
INDIO_BUFFER_SOFTWARE, NULL);
if (ret)
return ret;
- return devm_iio_device_register(&device->dev, indio_dev);
+ return devm_iio_device_register(dev, indio_dev);
}
static const struct acpi_device_id acpi_als_device_ids[] = {