[PATCH 0/3] i2c: remove 'of_node' from i2c_board_info

STALE503d

9 messages, 3 authors, 2025-05-20 · open the first message on its own page

[PATCH 0/3] i2c: remove 'of_node' from i2c_board_info

From: Wolfram Sang <wsa+renesas@sang-engineering.com>
Date: 2025-05-19 11:20:10

I promised Andy to support him in his cleanup efforts, and here is the
outcome for tidying up i2c_board_info. It seems it was easier than
anticipated. But my scanning scripts (awk, coccinelle) didn't find any
more occurences and the build bots are happy, too. It really seems this
is all that is left to do. No complaint, though.

Wolfram Sang (3):
  i2c: powermac: convert of_node usage to fwnode
  i2c: use only 'fwnode' for client devices
  i2c: remove 'of_node' member from i2c_boardinfo

 drivers/i2c/busses/i2c-powermac.c | 2 +-
 drivers/i2c/i2c-core-base.c       | 3 +--
 include/linux/i2c.h               | 2 --
 3 files changed, 2 insertions(+), 5 deletions(-)

-- 
2.47.2

Re: [PATCH 1/3] i2c: powermac: convert of_node usage to fwnode

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: 2025-05-19 11:19:52

On Mon, May 19, 2025 at 01:13:12PM +0200, Wolfram Sang wrote:
'of_node' in i2c_boardinfo is deprecated in favor of 'fwnode'. The I2C
core handles them equally, so simply convert this driver to fwnode.
...
-		info.of_node = of_node_get(node);
+		info.fwnode = of_fwnode_handle(of_node_get(node));
What puzzles me here is that of_node_get(). We already do the same in the I²C
core, does it really need the second bump of the reference counting?

In any case, this patch doesn't change the status quo, I'm fine to leave the
research for the later.

-- 
With Best Regards,
Andy Shevchenko


[PATCH 1/3] i2c: powermac: convert of_node usage to fwnode

From: Wolfram Sang <wsa+renesas@sang-engineering.com>
Date: 2025-05-19 11:20:10

'of_node' in i2c_boardinfo is deprecated in favor of 'fwnode'. The I2C
core handles them equally, so simply convert this driver to fwnode.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/i2c/busses/i2c-powermac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c
index 9a867c817db0..f99a2cc721a8 100644
--- a/drivers/i2c/busses/i2c-powermac.c
+++ b/drivers/i2c/busses/i2c-powermac.c
@@ -349,7 +349,7 @@ static void i2c_powermac_register_devices(struct i2c_adapter *adap,
 		/* Fill out the rest of the info structure */
 		info.addr = addr;
 		info.irq = irq_of_parse_and_map(node, 0);
-		info.of_node = of_node_get(node);
+		info.fwnode = of_fwnode_handle(of_node_get(node));
 
 		newdev = i2c_new_client_device(adap, &info);
 		if (IS_ERR(newdev)) {
-- 
2.47.2

Re: [PATCH 0/3] i2c: remove 'of_node' from i2c_board_info

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: 2025-05-19 11:20:24

On Mon, May 19, 2025 at 01:13:11PM +0200, Wolfram Sang wrote:
I promised Andy to support him in his cleanup efforts, and here is the
outcome for tidying up i2c_board_info. It seems it was easier than
anticipated. But my scanning scripts (awk, coccinelle) didn't find any
more occurences and the build bots are happy, too. It really seems this
is all that is left to do. No complaint, though.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

-- 
With Best Regards,
Andy Shevchenko


Re: [PATCH 1/3] i2c: powermac: convert of_node usage to fwnode

From: Wolfram Sang <wsa+renesas@sang-engineering.com>
Date: 2025-05-19 11:25:19

quoted
-		info.of_node = of_node_get(node);
+		info.fwnode = of_fwnode_handle(of_node_get(node));
What puzzles me here is that of_node_get(). We already do the same in the I²C
core, does it really need the second bump of the reference counting?
I'd think so. i2c_board_info has its own source file outside of the I2C
core because it is used before the I2C core is even initialized. That is
basically the reason for its existence.

Re: [PATCH 1/3] i2c: powermac: convert of_node usage to fwnode

From: Andi Shyti <andi.shyti@kernel.org>
Date: 2025-05-19 22:04:03

Hi Wolfram,

On Mon, May 19, 2025 at 01:13:12PM +0200, Wolfram Sang wrote:
'of_node' in i2c_boardinfo is deprecated in favor of 'fwnode'. The I2C
core handles them equally, so simply convert this driver to fwnode.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
I took this patch in i2c/i2c-host. Please let me know if you want
me to take also the others.

Thanks,
Andi

Re: [PATCH 1/3] i2c: powermac: convert of_node usage to fwnode

From: Wolfram Sang <wsa+renesas@sang-engineering.com>
Date: 2025-05-20 09:15:35

I took this patch in i2c/i2c-host. Please let me know if you want
me to take also the others.
To avoid the dependency with your PR, is it okay if you drop it and I
take this patch via my tree?

Re: [PATCH 1/3] i2c: powermac: convert of_node usage to fwnode

From: Andi Shyti <andi.shyti@kernel.org>
Date: 2025-05-20 09:39:42

Hi Wolfram,

On Tue, May 20, 2025 at 11:15:21AM +0200, Wolfram Sang wrote:
quoted
I took this patch in i2c/i2c-host. Please let me know if you want
me to take also the others.
To avoid the dependency with your PR, is it okay if you drop it and I
take this patch via my tree?
yes, sure! I will take it out.

Thanks,
Andi

Re: [PATCH 0/3] i2c: remove 'of_node' from i2c_board_info

From: Wolfram Sang <wsa+renesas@sang-engineering.com>
Date: 2025-05-20 20:50:52

On Mon, May 19, 2025 at 01:13:11PM +0200, Wolfram Sang wrote:
I promised Andy to support him in his cleanup efforts, and here is the
outcome for tidying up i2c_board_info. It seems it was easier than
anticipated. But my scanning scripts (awk, coccinelle) didn't find any
more occurences and the build bots are happy, too. It really seems this
is all that is left to do. No complaint, though.
Applied to for-next.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help