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

Andy Shevchenko posted 7 patches 8 months, 2 weeks ago
There is a newer version of this series
[PATCH v3 6/7] i2c: core: Deprecate of_node in struct i2c_board_info
Posted by Andy Shevchenko 8 months, 2 weeks ago
Two members of the same or similar semantics is quite confusing to begin with.
Moreover, the 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 remote it completely.

Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.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 v3 6/7] i2c: core: Deprecate of_node in struct i2c_board_info
Posted by Sakari Ailus 8 months, 2 weeks ago
Hi Andy,

On Mon, Apr 07, 2025 at 06:45:02PM +0300, Andy Shevchenko wrote:
> Two members of the same or similar semantics is quite confusing to begin with.
> Moreover, the 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 remote it completely.

Too long lines, should be up to 75 characters long only.

> 
> Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.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

-- 
Regards,

Sakari Ailus
Re: [PATCH v3 6/7] i2c: core: Deprecate of_node in struct i2c_board_info
Posted by Andy Shevchenko 8 months, 2 weeks ago
On Tue, Apr 08, 2025 at 02:42:51PM +0000, Sakari Ailus wrote:
> On Mon, Apr 07, 2025 at 06:45:02PM +0300, Andy Shevchenko wrote:
> > Two members of the same or similar semantics is quite confusing to begin with.
> > Moreover, the 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 remote it completely.
> 
> Too long lines, should be up to 75 characters long only.

It's media CI complains, but this code is for I²C :-)
But in _this_ case I agree with you. It's more for the
external users of Git, rather than for us.

-- 
With Best Regards,
Andy Shevchenko