On Mon, Nov 13, 2023 at 08:04:03AM +0300, Alexander Shiyan wrote: > > Hello. > > > Returning an error code from .remove() makes the driver core emit the > > little helpful error message: > > > remove callback returned a non-zero value. This will be ignored. > > > and then remove the device anyhow. > > > > So replace the error return (and with it the little helpful error > > message) by a more useful error message. > ... > > - if (!IS_ERR(s->regulator)) > > - return regulator_disable(s->regulator); > > + if (!IS_ERR(s->regulator)) { > > + int ret = regulator_disable(s->regulator); > > + if (ret) > > + dev_err(&pdev->dev, "Failed to disable regulator\n"); > > + } > > > > return 0; > > return ret ? No, return 0 is right. Please look at platform_remove() in drivers/base/platform.c and optionally reread the commit log to convince yourself about that. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ |
Attachment:
signature.asc
Description: PGP signature