]> git.baikalelectronics.ru Git - kernel.git/commit
iio:proximity:sx_common: Fix device property parsing on DT systems
authorStephen Boyd <swboyd@chromium.org>
Thu, 31 Mar 2022 21:04:25 +0000 (14:04 -0700)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 4 Apr 2022 08:19:01 +0000 (09:19 +0100)
commita2d22d5725eb4b6bf03b2c958226de462c83dfbf
treef44e2c8d569f8f9e888fc40fb2a52343bd5e1854
parent872de6cf0495a37a76808effa5d042630c995673
iio:proximity:sx_common: Fix device property parsing on DT systems

After commit 853e80ec9e35 ("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@chromium.org>
Fixes: 853e80ec9e35 ("iio: sx9310: Support ACPI property")
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Link: https://lore.kernel.org/r/20220331210425.3908278-1-swboyd@chromium.org
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/proximity/sx_common.c