* [PATCH 0/3] i2c: remove 'of_node' from i2c_board_info
@ 2025-05-19 11:13 Wolfram Sang
2025-05-19 11:13 ` [PATCH 1/3] i2c: powermac: convert of_node usage to fwnode Wolfram Sang
` (4 more replies)
0 siblings, 5 replies; 13+ messages in thread
From: Wolfram Sang @ 2025-05-19 11:13 UTC (permalink / raw)
To: linux-i2c
Cc: Andy Shevchenko, Wolfram Sang, Andi Shyti, Christophe Leroy,
linuxppc-dev, Madhavan Srinivasan, Michael Ellerman, Naveen N Rao,
Nicholas Piggin
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
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 1/3] i2c: powermac: convert of_node usage to fwnode
2025-05-19 11:13 [PATCH 0/3] i2c: remove 'of_node' from i2c_board_info Wolfram Sang
@ 2025-05-19 11:13 ` Wolfram Sang
2025-05-19 11:18 ` Andy Shevchenko
2025-05-19 22:03 ` Andi Shyti
2025-05-19 11:13 ` [PATCH 2/3] i2c: use only 'fwnode' for client devices Wolfram Sang
` (3 subsequent siblings)
4 siblings, 2 replies; 13+ messages in thread
From: Wolfram Sang @ 2025-05-19 11:13 UTC (permalink / raw)
To: linux-i2c
Cc: Andy Shevchenko, Wolfram Sang, Andi Shyti, Madhavan Srinivasan,
Michael Ellerman, Nicholas Piggin, Christophe Leroy, Naveen N Rao,
linuxppc-dev
'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
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 2/3] i2c: use only 'fwnode' for client devices
2025-05-19 11:13 [PATCH 0/3] i2c: remove 'of_node' from i2c_board_info Wolfram Sang
2025-05-19 11:13 ` [PATCH 1/3] i2c: powermac: convert of_node usage to fwnode Wolfram Sang
@ 2025-05-19 11:13 ` Wolfram Sang
2025-05-19 21:10 ` Andi Shyti
2025-05-19 11:13 ` [PATCH 3/3] i2c: remove 'of_node' member from i2c_boardinfo Wolfram Sang
` (2 subsequent siblings)
4 siblings, 1 reply; 13+ messages in thread
From: Wolfram Sang @ 2025-05-19 11:13 UTC (permalink / raw)
To: linux-i2c; +Cc: Andy Shevchenko, Wolfram Sang
No client sets 'of_node' anymore, so we don't need to handle the case in
the core anymore.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/i2c/i2c-core-base.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index dc3c60a7d382..63ffde07a143 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -961,7 +961,7 @@ static void i2c_unlock_addr(struct i2c_adapter *adap, unsigned short addr,
struct i2c_client *
i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *info)
{
- struct fwnode_handle *fwnode;
+ struct fwnode_handle *fwnode = info->fwnode;
struct i2c_client *client;
bool need_put = false;
int status;
@@ -1005,7 +1005,6 @@ i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *inf
device_enable_async_suspend(&client->dev);
- fwnode = info->fwnode ?: of_fwnode_handle(info->of_node);
device_set_node(&client->dev, fwnode_handle_get(fwnode));
if (info->swnode) {
--
2.47.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 3/3] i2c: remove 'of_node' member from i2c_boardinfo
2025-05-19 11:13 [PATCH 0/3] i2c: remove 'of_node' from i2c_board_info Wolfram Sang
2025-05-19 11:13 ` [PATCH 1/3] i2c: powermac: convert of_node usage to fwnode Wolfram Sang
2025-05-19 11:13 ` [PATCH 2/3] i2c: use only 'fwnode' for client devices Wolfram Sang
@ 2025-05-19 11:13 ` Wolfram Sang
2025-05-19 21:10 ` Andi Shyti
2025-05-19 11:19 ` [PATCH 0/3] i2c: remove 'of_node' from i2c_board_info Andy Shevchenko
2025-05-20 20:50 ` Wolfram Sang
4 siblings, 1 reply; 13+ messages in thread
From: Wolfram Sang @ 2025-05-19 11:13 UTC (permalink / raw)
To: linux-i2c; +Cc: Andy Shevchenko, Wolfram Sang
There is no user of this member anymore. We can remove it.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
include/linux/i2c.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index cc1437f29823..20fd41b51d5c 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -405,7 +405,6 @@ static inline bool i2c_detect_slave_mode(struct device *dev) { return false; }
* @addr: stored in i2c_client.addr
* @dev_name: Overrides the default <busnr>-<addr> dev_name if set
* @platform_data: stored in i2c_client.dev.platform_data
- * @of_node: **DEPRECATED** - use @fwnode for this
* @fwnode: device node supplied by the platform firmware
* @swnode: software node for the device
* @resources: resources associated with the device
@@ -429,7 +428,6 @@ struct i2c_board_info {
unsigned short addr;
const char *dev_name;
void *platform_data;
- struct device_node *of_node;
struct fwnode_handle *fwnode;
const struct software_node *swnode;
const struct resource *resources;
--
2.47.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 1/3] i2c: powermac: convert of_node usage to fwnode
2025-05-19 11:13 ` [PATCH 1/3] i2c: powermac: convert of_node usage to fwnode Wolfram Sang
@ 2025-05-19 11:18 ` Andy Shevchenko
2025-05-19 11:25 ` Wolfram Sang
2025-05-19 22:03 ` Andi Shyti
1 sibling, 1 reply; 13+ messages in thread
From: Andy Shevchenko @ 2025-05-19 11:18 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-i2c, Andi Shyti, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao, linuxppc-dev
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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 0/3] i2c: remove 'of_node' from i2c_board_info
2025-05-19 11:13 [PATCH 0/3] i2c: remove 'of_node' from i2c_board_info Wolfram Sang
` (2 preceding siblings ...)
2025-05-19 11:13 ` [PATCH 3/3] i2c: remove 'of_node' member from i2c_boardinfo Wolfram Sang
@ 2025-05-19 11:19 ` Andy Shevchenko
2025-05-20 20:50 ` Wolfram Sang
4 siblings, 0 replies; 13+ messages in thread
From: Andy Shevchenko @ 2025-05-19 11:19 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-i2c, Andi Shyti, Christophe Leroy, linuxppc-dev,
Madhavan Srinivasan, Michael Ellerman, Naveen N Rao,
Nicholas Piggin
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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/3] i2c: powermac: convert of_node usage to fwnode
2025-05-19 11:18 ` Andy Shevchenko
@ 2025-05-19 11:25 ` Wolfram Sang
0 siblings, 0 replies; 13+ messages in thread
From: Wolfram Sang @ 2025-05-19 11:25 UTC (permalink / raw)
To: Andy Shevchenko
Cc: linux-i2c, Andi Shyti, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao, linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 453 bytes --]
> > - 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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/3] i2c: use only 'fwnode' for client devices
2025-05-19 11:13 ` [PATCH 2/3] i2c: use only 'fwnode' for client devices Wolfram Sang
@ 2025-05-19 21:10 ` Andi Shyti
0 siblings, 0 replies; 13+ messages in thread
From: Andi Shyti @ 2025-05-19 21:10 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-i2c, Andy Shevchenko
Hi Wolfram,
On Mon, May 19, 2025 at 01:13:13PM +0200, Wolfram Sang wrote:
> No client sets 'of_node' anymore, so we don't need to handle the case in
> the core anymore.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Thanks,
Andi
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 3/3] i2c: remove 'of_node' member from i2c_boardinfo
2025-05-19 11:13 ` [PATCH 3/3] i2c: remove 'of_node' member from i2c_boardinfo Wolfram Sang
@ 2025-05-19 21:10 ` Andi Shyti
0 siblings, 0 replies; 13+ messages in thread
From: Andi Shyti @ 2025-05-19 21:10 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-i2c, Andy Shevchenko
Hi Wolfram,
On Mon, May 19, 2025 at 01:13:14PM +0200, Wolfram Sang wrote:
> There is no user of this member anymore. We can remove it.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Thanks,
Andi
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/3] i2c: powermac: convert of_node usage to fwnode
2025-05-19 11:13 ` [PATCH 1/3] i2c: powermac: convert of_node usage to fwnode Wolfram Sang
2025-05-19 11:18 ` Andy Shevchenko
@ 2025-05-19 22:03 ` Andi Shyti
2025-05-20 9:15 ` Wolfram Sang
1 sibling, 1 reply; 13+ messages in thread
From: Andi Shyti @ 2025-05-19 22:03 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-i2c, Andy Shevchenko, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao, linuxppc-dev
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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/3] i2c: powermac: convert of_node usage to fwnode
2025-05-19 22:03 ` Andi Shyti
@ 2025-05-20 9:15 ` Wolfram Sang
2025-05-20 9:39 ` Andi Shyti
0 siblings, 1 reply; 13+ messages in thread
From: Wolfram Sang @ 2025-05-20 9:15 UTC (permalink / raw)
To: Andi Shyti
Cc: linux-i2c, Andy Shevchenko, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao, linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 200 bytes --]
> 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?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/3] i2c: powermac: convert of_node usage to fwnode
2025-05-20 9:15 ` Wolfram Sang
@ 2025-05-20 9:39 ` Andi Shyti
0 siblings, 0 replies; 13+ messages in thread
From: Andi Shyti @ 2025-05-20 9:39 UTC (permalink / raw)
To: Wolfram Sang, linux-i2c, Andy Shevchenko, Madhavan Srinivasan,
Michael Ellerman, Nicholas Piggin, Christophe Leroy, Naveen N Rao,
linuxppc-dev
Hi Wolfram,
On Tue, May 20, 2025 at 11:15:21AM +0200, Wolfram Sang wrote:
>
> > 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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 0/3] i2c: remove 'of_node' from i2c_board_info
2025-05-19 11:13 [PATCH 0/3] i2c: remove 'of_node' from i2c_board_info Wolfram Sang
` (3 preceding siblings ...)
2025-05-19 11:19 ` [PATCH 0/3] i2c: remove 'of_node' from i2c_board_info Andy Shevchenko
@ 2025-05-20 20:50 ` Wolfram Sang
4 siblings, 0 replies; 13+ messages in thread
From: Wolfram Sang @ 2025-05-20 20:50 UTC (permalink / raw)
To: linux-i2c
Cc: Andy Shevchenko, Andi Shyti, Christophe Leroy, linuxppc-dev,
Madhavan Srinivasan, Michael Ellerman, Naveen N Rao,
Nicholas Piggin
[-- Attachment #1: Type: text/plain, Size: 425 bytes --]
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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2025-05-20 20:50 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-19 11:13 [PATCH 0/3] i2c: remove 'of_node' from i2c_board_info Wolfram Sang
2025-05-19 11:13 ` [PATCH 1/3] i2c: powermac: convert of_node usage to fwnode Wolfram Sang
2025-05-19 11:18 ` Andy Shevchenko
2025-05-19 11:25 ` Wolfram Sang
2025-05-19 22:03 ` Andi Shyti
2025-05-20 9:15 ` Wolfram Sang
2025-05-20 9:39 ` Andi Shyti
2025-05-19 11:13 ` [PATCH 2/3] i2c: use only 'fwnode' for client devices Wolfram Sang
2025-05-19 21:10 ` Andi Shyti
2025-05-19 11:13 ` [PATCH 3/3] i2c: remove 'of_node' member from i2c_boardinfo Wolfram Sang
2025-05-19 21:10 ` Andi Shyti
2025-05-19 11:19 ` [PATCH 0/3] i2c: remove 'of_node' from i2c_board_info Andy Shevchenko
2025-05-20 20:50 ` Wolfram Sang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox