[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPUE2uvpBaE+YLkg6RXq4CCEFBr5ZFhjS1dXkbse9nyH8C=2Jg@mail.gmail.com>
Date: Fri, 1 Apr 2022 13:54:51 -0700
From: Gwendal Grignou <gwendal@...omium.org>
To: Stephen Boyd <swboyd@...omium.org>
Cc: Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
linux-kernel@...r.kernel.org, linux-iio@...r.kernel.org
Subject: Re: [PATCH] iio:proximity:sx_common: Fix device property parsing on
DT systems
On Thu, Mar 31, 2022 at 2:04 PM Stephen Boyd <swboyd@...omium.org> wrote:
>
> After commit 7a3605bef878 ("iio: sx9310: Support ACPI property") we
> started using the 'indio_dev->dev' to extract device properties for
> various register settings in sx9310_get_default_reg(). This broke DT
> based systems because dev_fwnode() used in the device_property*() APIs
> can't find an 'of_node'. That's because the 'indio_dev->dev.of_node'
> pointer isn't set until iio_device_register() is called. Set the pointer
> earlier, next to where the ACPI companion is set, so that the device
> property APIs work on DT systems.
>
> Cc: Gwendal Grignou <gwendal@...omium.org>
> Fixes: 7a3605bef878 ("iio: sx9310: Support ACPI property")
> Signed-off-by: Stephen Boyd <swboyd@...omium.org>
Reviewed-by: Gwendal Grignou <gwendal@...omium.org>
> ---
> drivers/iio/proximity/sx_common.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/iio/proximity/sx_common.c b/drivers/iio/proximity/sx_common.c
> index a7c07316a0a9..8ad814d96b7e 100644
> --- a/drivers/iio/proximity/sx_common.c
> +++ b/drivers/iio/proximity/sx_common.c
> @@ -521,6 +521,7 @@ int sx_common_probe(struct i2c_client *client,
> return dev_err_probe(dev, ret, "error reading WHOAMI\n");
>
> ACPI_COMPANION_SET(&indio_dev->dev, ACPI_COMPANION(dev));
> + indio_dev->dev.of_node = client->dev.of_node;
> indio_dev->modes = INDIO_DIRECT_MODE;
>
> indio_dev->channels = data->chip_info->iio_channels;
> --
> https://chromeos.dev
>
Powered by blists - more mailing lists