[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230711054147.506437-1-aryan.srivastava@alliedtelesis.co.nz>
Date: Tue, 11 Jul 2023 17:41:46 +1200
From: Aryan Srivastava <aryan.srivastava@...iedtelesis.co.nz>
To: rric@...nel.org
Cc: linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org,
Chris.Packham@...iedtelesis.co.nz,
Aryan Srivastava <aryan.srivastava@...iedtelesis.co.nz>
Subject: [PATCH] i2c:thunderx:Add disabled node check
Add check for disabled nodes. These nodes should not be probed. Can
result in logging for HW which is not present.
Signed-off-by: Aryan Srivastava <aryan.srivastava@...iedtelesis.co.nz>
---
drivers/i2c/busses/i2c-thunderx-pcidrv.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/i2c/busses/i2c-thunderx-pcidrv.c b/drivers/i2c/busses/i2c-thunderx-pcidrv.c
index a77cd86fe75e..7fcdb237076a 100644
--- a/drivers/i2c/busses/i2c-thunderx-pcidrv.c
+++ b/drivers/i2c/busses/i2c-thunderx-pcidrv.c
@@ -158,6 +158,10 @@ static int thunder_i2c_probe_pci(struct pci_dev *pdev,
struct octeon_i2c *i2c;
int ret;
+ /* Ignore disabled nodes. */
+ if (!of_device_is_available(pdev->dev.of_node))
+ return 0;
+
i2c = devm_kzalloc(dev, sizeof(*i2c), GFP_KERNEL);
if (!i2c)
return -ENOMEM;
--
2.41.0
Powered by blists - more mailing lists