[PATCH v4 6/7] i2c: core: Deprecate of_node in struct i2c_board_info

Andy Shevchenko posted 7 patches 10 months ago
There is a newer version of this series
[PATCH v4 6/7] i2c: core: Deprecate of_node in struct i2c_board_info
Posted by Andy Shevchenko 10 months ago
Two members of the same or quite similar semantics is quite confusing
to begin with. Moreover, fwnode covers all possible firmware descriptions
that Linux kernel supports. Deprecate of_node in struct i2c_board_info,
so users will be warned and in the future remove it completely.

Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/i2c.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 2e4903b7f7bc..cc1437f29823 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -405,7 +405,7 @@ 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: pointer to OpenFirmware device node
+ * @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
-- 
2.47.2
Re: [PATCH v4 6/7] i2c: core: Deprecate of_node in struct i2c_board_info
Posted by Wolfram Sang 9 months, 4 weeks ago
> that Linux kernel supports. Deprecate of_node in struct i2c_board_info,
> so users will be warned and in the future remove it completely.

Is there a plan or volunteer to do the conversion?

Re: [PATCH v4 6/7] i2c: core: Deprecate of_node in struct i2c_board_info
Posted by Andy Shevchenko 9 months, 4 weeks ago
On Tue, Apr 15, 2025 at 10:10:14PM +0200, Wolfram Sang wrote:
> 
> > that Linux kernel supports. Deprecate of_node in struct i2c_board_info,
> > so users will be warned and in the future remove it completely.
> 
> Is there a plan or volunteer to do the conversion?

Yes, long-term as I'm alone for many janitor works.

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH v4 6/7] i2c: core: Deprecate of_node in struct i2c_board_info
Posted by Wolfram Sang 9 months, 4 weeks ago
> > > that Linux kernel supports. Deprecate of_node in struct i2c_board_info,
> > > so users will be warned and in the future remove it completely.
> > 
> > Is there a plan or volunteer to do the conversion?
> 
> Yes, long-term as I'm alone for many janitor works.

I could help here if you are not keen on doing it on your own.

Re: [PATCH v4 6/7] i2c: core: Deprecate of_node in struct i2c_board_info
Posted by Andy Shevchenko 9 months, 4 weeks ago
On Wed, Apr 16, 2025 at 08:54:22AM +0200, Wolfram Sang wrote:
> 
> > > > that Linux kernel supports. Deprecate of_node in struct i2c_board_info,
> > > > so users will be warned and in the future remove it completely.
> > > 
> > > Is there a plan or volunteer to do the conversion?
> > 
> > Yes, long-term as I'm alone for many janitor works.
> 
> I could help here if you are not keen on doing it on your own.

Thanks!

At least the main objective is to avoid new code using of_node.
The rest can slowly rotten on itself (esp. if there is any under
arch/ for some old board files).

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH v4 6/7] i2c: core: Deprecate of_node in struct i2c_board_info
Posted by Wolfram Sang 9 months, 3 weeks ago
> At least the main objective is to avoid new code using of_node.
> The rest can slowly rotten on itself (esp. if there is any under
> arch/ for some old board files).

Do you know of some examples? I mainly found i2c-powermac and I3C core
with my two approaches (coccinelle and grep+awk). But maybe my search
pattern is weak?

Re: [PATCH v4 6/7] i2c: core: Deprecate of_node in struct i2c_board_info
Posted by Andy Shevchenko 9 months, 3 weeks ago
On Wed, Apr 16, 2025 at 03:00:16PM +0200, Wolfram Sang wrote:
> 
> > At least the main objective is to avoid new code using of_node.
> > The rest can slowly rotten on itself (esp. if there is any under
> > arch/ for some old board files).
> 
> Do you know of some examples? I mainly found i2c-powermac and I3C core
> with my two approaches (coccinelle and grep+awk). But maybe my search
> pattern is weak?

At least the first one is what I have a WIP in my local tree.
I haven't checked much and I anyway forgot the results already
(it was at the time of v1, so a couple of weeks ago or so).

-- 
With Best Regards,
Andy Shevchenko