Skip to content

Commit 3d7fdf2

Browse files
authored
iio: (dac/ds4424) Allow NULL of_node (sonic-net#236)
Cisco is using ACPI to read device configuration instead of OF (device-tree) for ds4424 device. Kernel is in a transition period in its support for ACPI (cisco using ACPI for kernel module configuration). The kernel makes a distinction between device tree (of_node) and ACPI (fw_node) in the device structure. It is unclear if they can be used together or not, but I can definitively say that we are only using ACPI and not device tree. In this particular driver, there was an explicit check for having a device tree node, even though no reference to the device tree was made within the driver. This caused the probe routine to fail with -ENODEV in cisco environment. This patch removes the check for of_node. Signed-off-by: Madhava Reddy Siddareddygari <[email protected]>
1 parent b9725ad commit 3d7fdf2

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

patch/cisco-ds4424-null-of-node.patch

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+

patch/series

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ cisco-mdio-mux-support-acpi.patch
9393
cisco-x86-gpio-config.patch
9494
cisco-acpi-spi-nor.patch
9595
cisco-Enable-static-memory-reservation-for-OIRable-PCIe-de.patch
96+
cisco-ds4424-null-of-node.patch
9697

9798
#
9899
# Marvell platform patches for 4.19

0 commit comments

Comments
 (0)