Re: [PATCH 1/2] i2c: Warn when device removing fails

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

 



Hey Wolfram,

On Thu, Dec 10, 2020 at 09:10:44PM +0100, Wolfram Sang wrote:
> On Thu, Nov 26, 2020 at 08:23:30AM +0100, Uwe Kleine-König wrote:
> > The driver core ignores the return value of struct bus_type::remove. So
> > warn if there is an error that went unnoticed before and return 0
> > unconditionally in i2c_device_remove().
> 
> I wondered about the "return 0" part...
> 
> > 
> > This prepares changing struct bus_type::remove to return void.
> 
> ... until I read this. You are working on that?

Yes, I'm not paid for it, but it serves as an idle cleanup task for me.
Greg even assists, see 8142a46c50d2dd8160c42284e1044eed3bec0d18. :-)

> 
> >  	if (driver->remove) {
> > +		int status = 0;
> 
> No need to initialize to 0, or?

Right, this comes straight from:
-	int status = 0;

from the current version of i2c_device_remove, where it was still
relevant. I don't feel strong here, and if you do I can resend or you
can fixup while applying.

> > +
> >  		dev_dbg(dev, "remove\n");
> > +
> >  		status = driver->remove(client);
> > +		if (status)
> > +			dev_warn(dev, "remove failed (%pe), will be ignored\n", ERR_PTR(status));
> 
> The rest and patch 2 look good.

Great.

Liebe Grüße aus Freiburg!
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

Attachment: signature.asc
Description: PGP signature


[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