|
| 1 | +From ec513d48cc5b25b98c15ec2a47658c71b2231f95 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Madhava Reddy Siddareddygari < [email protected]> |
| 3 | +Date: Sat, 25 Sep 2021 20:44:20 -0700 |
| 4 | +Subject: [PATCH] iio: (dac/ds4424) Allow NULL of_node |
| 5 | + |
| 6 | +Cisco is using ACPI to read device configuration instead of |
| 7 | +OF (device-tree) for ds4424 device. |
| 8 | + |
| 9 | +Kernel is in a transition period in its support for ACPI |
| 10 | +(cisco using ACPI for kernel module configuration). The kernel |
| 11 | +makes a distinction between device tree (of_node) and ACPI |
| 12 | +(fw_node) in the device structure. It is unclear if they can be |
| 13 | +used together or not, but I can definitively say that we are only |
| 14 | +using ACPI and not device tree. In this particular driver, there |
| 15 | +was an explicit check for having a device tree node, even though no |
| 16 | +reference to the device tree was made within the driver. This caused |
| 17 | +the probe routine to fail with -ENODEV in cisco environment. |
| 18 | + |
| 19 | +This patch removes the check for of_node. |
| 20 | + |
| 21 | +Signed-off-by: Madhava Reddy Siddareddygari < [email protected]> |
| 22 | +--- |
| 23 | + drivers/iio/dac/ds4424.c | 6 ------ |
| 24 | + 1 file changed, 6 deletions(-) |
| 25 | + |
| 26 | +diff --git a/drivers/iio/dac/ds4424.c b/drivers/iio/dac/ds4424.c |
| 27 | +index 714a97f91..ae9be7926 100644 |
| 28 | +--- a/drivers/iio/dac/ds4424.c |
| 29 | ++++ b/drivers/iio/dac/ds4424.c |
| 30 | +@@ -236,12 +236,6 @@ static int ds4424_probe(struct i2c_client *client, |
| 31 | + indio_dev->dev.of_node = client->dev.of_node; |
| 32 | + indio_dev->dev.parent = &client->dev; |
| 33 | + |
| 34 | +- if (!client->dev.of_node) { |
| 35 | +- dev_err(&client->dev, |
| 36 | +- "Not found DT.\n"); |
| 37 | +- return -ENODEV; |
| 38 | +- } |
| 39 | +- |
| 40 | + data->vcc_reg = devm_regulator_get(&client->dev, "vcc"); |
| 41 | + if (IS_ERR(data->vcc_reg)) { |
| 42 | + dev_err(&client->dev, |
| 43 | +-- |
| 44 | +2.26.2 |
| 45 | + |
0 commit comments