FAILED: patch "[PATCH] iio:proximity:sx_common: Fix device property parsing on DT" failed to apply to 5.17-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 5.17-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 74a53a959028e5f28e3c0e9445a876e5c8da147c Mon Sep 17 00:00:00 2001
From: Stephen Boyd <[email protected]>
Date: Thu, 31 Mar 2022 14:04:25 -0700
Subject: [PATCH] iio:proximity:sx_common: Fix device property parsing on DT
systems
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.
drivers/iio/proximity/sx_common.c +1 -0
@@ -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;