public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c:thunderx:Add disabled node check
@ 2023-07-11  5:41 Aryan Srivastava
  2023-10-29 17:11 ` Wolfram Sang
  0 siblings, 1 reply; 3+ messages in thread
From: Aryan Srivastava @ 2023-07-11  5:41 UTC (permalink / raw)
  To: rric; +Cc: linux-i2c, linux-kernel, Chris.Packham, Aryan Srivastava

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@alliedtelesis.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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] i2c:thunderx:Add disabled node check
  2023-07-11  5:41 [PATCH] i2c:thunderx:Add disabled node check Aryan Srivastava
@ 2023-10-29 17:11 ` Wolfram Sang
  2023-10-29 21:47   ` Chris Packham
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfram Sang @ 2023-10-29 17:11 UTC (permalink / raw)
  To: Aryan Srivastava; +Cc: rric, linux-i2c, linux-kernel, Chris.Packham

[-- Attachment #1: Type: text/plain, Size: 355 bytes --]

On Tue, Jul 11, 2023 at 05:41:46PM +1200, Aryan Srivastava wrote:
> 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@alliedtelesis.co.nz>

I am confused. This is a PCI driver, no? Why should we deal with DT
settings here?


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] i2c:thunderx:Add disabled node check
  2023-10-29 17:11 ` Wolfram Sang
@ 2023-10-29 21:47   ` Chris Packham
  0 siblings, 0 replies; 3+ messages in thread
From: Chris Packham @ 2023-10-29 21:47 UTC (permalink / raw)
  To: Wolfram Sang, Aryan Srivastava, rric@kernel.org,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org


On 30/10/23 06:11, Wolfram Sang wrote:
> On Tue, Jul 11, 2023 at 05:41:46PM +1200, Aryan Srivastava wrote:
>> 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@alliedtelesis.co.nz>
> I am confused. This is a PCI driver, no? Why should we deal with DT
> settings here?

It is a PCI driver but the IP block is included on SoCs like the CN9670 
and not all hardware designs make use of all the I2C interfaces that the 
IP block supports.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-29 21:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-11  5:41 [PATCH] i2c:thunderx:Add disabled node check Aryan Srivastava
2023-10-29 17:11 ` Wolfram Sang
2023-10-29 21:47   ` Chris Packham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox