Re: [PATCH v1] i2c: icy: Don't use software node when it's an overkill

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 10, 2020 at 01:51:58AM +0200, Max Staudt wrote:
> On 4/9/20 2:16 PM, Heikki Krogerus wrote:
> > On Thu, Apr 09, 2020 at 01:37:35PM +0300, Andy Shevchenko wrote:
> >> Heikki, am I correct?
> > 
> > In this case it should be possible supply a handle to a software node
> > with the board info. That should then later replace the fwnode and
> > properties members once the existing code is converted:
> > 
> > [... snip sample patch ...]
> > 
> > I2C core would then need to take care of registering that swnode of
> > course.
> 
> Are you saying that the comment in property.c is correct, and
> i2c_new_client_device() shall *not* call device_add_properties() ?
> 
> I mean, the code works and stuff, except that the swnode that
> device_add_properties() created won't be freed as far as I can see.

They actually are freed when device_del() is finally called, which is
pretty damn confusing. That is actually one of the reasons why we
should avoid the old device_add/del_properties() API.

> In other words, should the current properties code in i2c_new_client_device()
> be replaced by something that creates a swnode, just like the i2c-icy driver
> currently does manually when it instantiates the ltc2990 I2C client?

Yes. The subsystem needs to take care of that, not the drivers.

thanks,

-- 
heikki



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux