Use dev = &device->dev in probe routine for clarity. Signed-off-by: Gwendal Grignou <gwendal@xxxxxxxxxxxx> Reviewed-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx> --- Changes in v7: Rebased, replace &device->dev at new locations. No changes in v6. Changes in v5: Follow inverted xmas tree declaration convention. Added in v4. drivers/iio/light/acpi-als.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/iio/light/acpi-als.c b/drivers/iio/light/acpi-als.c index 784868aa8fbf7..a2107945cff93 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[] = { -- 2.31.0.rc2.261.g7f71774620-goog