mbox series

[v3,0/7] i2c: core: Move client towards fwnode

Message ID 20250407154937.744466-1-andriy.shevchenko@linux.intel.com (mailing list archive)
Headers show
Series i2c: core: Move client towards fwnode | expand

Message

Andy Shevchenko April 7, 2025, 3:44 p.m. UTC
The struct i2c_board_info has of_node and fwnode members. This is quite
confusing as they are of the same semantics and it's tend to have an issue
if user assigns both. Luckily there is only a single driver that does this
and fix is provided in the last patch. Nevertheless the series moves
the client handling code to use fwnode and deprecates the of_node member
in the respective documentation.

Tomi tested the last patch, but since it was separate there is no tag (yet).

In v3:
- fixed compile issues with i2c-core-slave.c (LKP)
- fixed compile issues with IRQ APIs, i.e. missing header (LKP)
- added patch for the only user which assigns two fields (Tomi)
- added tags (Tomi)

In v2:
- covered i2c-core-slave.c where it makes sense
- covered i2c-core-of.c where it makes sense
- rebased on top of the latest code base

Andy Shevchenko (7):
  i2c: core: Drop duplicate check before calling OF APIs
  i2c: core: Unify the firmware node type check
  i2c: core: Switch to fwnode APIs to get IRQ
  i2c: core: Reuse fwnode variable where it makes sense
  i2c: core: Do not dereference fwnode in struct device
  i2c: core: Deprecate of_node in struct i2c_board_info
  media: i2c: ds90ub960: Remove of_node assignment

 drivers/i2c/i2c-core-base.c   | 61 +++++++++++++++++------------------
 drivers/i2c/i2c-core-of.c     |  1 -
 drivers/i2c/i2c-core-slave.c  | 12 ++++---
 drivers/media/i2c/ds90ub960.c |  1 -
 include/linux/i2c.h           |  2 +-
 5 files changed, 39 insertions(+), 38 deletions(-)

Comments

Sakari Ailus April 8, 2025, 2:43 p.m. UTC | #1
Hi Andy,

On Mon, Apr 07, 2025 at 06:44:56PM +0300, Andy Shevchenko wrote:
> The struct i2c_board_info has of_node and fwnode members. This is quite
> confusing as they are of the same semantics and it's tend to have an issue
> if user assigns both. Luckily there is only a single driver that does this
> and fix is provided in the last patch. Nevertheless the series moves
> the client handling code to use fwnode and deprecates the of_node member
> in the respective documentation.
> 
> Tomi tested the last patch, but since it was separate there is no tag (yet).

Apart from the two minor commit message comments:

Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Andy Shevchenko April 8, 2025, 2:48 p.m. UTC | #2
On Tue, Apr 08, 2025 at 02:43:40PM +0000, Sakari Ailus wrote:
> On Mon, Apr 07, 2025 at 06:44:56PM +0300, Andy Shevchenko wrote:
> > The struct i2c_board_info has of_node and fwnode members. This is quite
> > confusing as they are of the same semantics and it's tend to have an issue
> > if user assigns both. Luckily there is only a single driver that does this
> > and fix is provided in the last patch. Nevertheless the series moves
> > the client handling code to use fwnode and deprecates the of_node member
> > in the respective documentation.
> > 
> > Tomi tested the last patch, but since it was separate there is no tag (yet).
> 
> Apart from the two minor commit message comments:
> 
> Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Thank you for your review!
Does it imply that media patch can go via I²C subsystem?
Sakari Ailus April 8, 2025, 3:08 p.m. UTC | #3
On Tue, Apr 08, 2025 at 05:48:53PM +0300, Andy Shevchenko wrote:
> On Tue, Apr 08, 2025 at 02:43:40PM +0000, Sakari Ailus wrote:
> > On Mon, Apr 07, 2025 at 06:44:56PM +0300, Andy Shevchenko wrote:
> > > The struct i2c_board_info has of_node and fwnode members. This is quite
> > > confusing as they are of the same semantics and it's tend to have an issue
> > > if user assigns both. Luckily there is only a single driver that does this
> > > and fix is provided in the last patch. Nevertheless the series moves
> > > the client handling code to use fwnode and deprecates the of_node member
> > > in the respective documentation.
> > > 
> > > Tomi tested the last patch, but since it was separate there is no tag (yet).
> > 
> > Apart from the two minor commit message comments:
> > 
> > Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> 
> Thank you for your review!
> Does it imply that media patch can go via I²C subsystem?

Good point. Yes, and you can use this for the last patch:

Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>

I wonder if Tomi would still be able to test (or at least ack) it. I see he
has tested the rest but this one is missing hist Tested-by:.
Tomi Valkeinen April 8, 2025, 4:35 p.m. UTC | #4
On 08/04/2025 18:08, Sakari Ailus wrote:
> On Tue, Apr 08, 2025 at 05:48:53PM +0300, Andy Shevchenko wrote:
>> On Tue, Apr 08, 2025 at 02:43:40PM +0000, Sakari Ailus wrote:
>>> On Mon, Apr 07, 2025 at 06:44:56PM +0300, Andy Shevchenko wrote:
>>>> The struct i2c_board_info has of_node and fwnode members. This is quite
>>>> confusing as they are of the same semantics and it's tend to have an issue
>>>> if user assigns both. Luckily there is only a single driver that does this
>>>> and fix is provided in the last patch. Nevertheless the series moves
>>>> the client handling code to use fwnode and deprecates the of_node member
>>>> in the respective documentation.
>>>>
>>>> Tomi tested the last patch, but since it was separate there is no tag (yet).
>>>
>>> Apart from the two minor commit message comments:
>>>
>>> Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
>>
>> Thank you for your review!
>> Does it imply that media patch can go via I²C subsystem?
> 
> Good point. Yes, and you can use this for the last patch:
> 
> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> 
> I wonder if Tomi would still be able to test (or at least ack) it. I see he
> has tested the rest but this one is missing hist Tested-by:.

I think Andy just missed it, as it wasn't explicit. I did test the v2, 
with the 7th patch from this series on top (it was not included in v2). 
I haven't tested v3, but I don't think anything really has changed.

  Tomi