From: Uwe Kleine-König Date: Sun, 7 Feb 2021 21:55:56 +0000 (+0100) Subject: ipack: Handle a driver without remove callback X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=609cf09c56802f7997497b1fdc89209db52d4449;p=linux.git ipack: Handle a driver without remove callback A driver that only consumes devm-managed resources might well have no remove callback. Additionally given that the device core ignores the return value of ipack_bus_remove() stop returning an error code. Signed-off-by: Uwe Kleine-König Acked-by: Samuel Iglesias Gonsalvez Link: https://lore.kernel.org/r/20210207215556.96371-2-uwe@kleine-koenig.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/ipack/ipack.c b/drivers/ipack/ipack.c index eabc4d08792af..7de9605cac4fd 100644 --- a/drivers/ipack/ipack.c +++ b/drivers/ipack/ipack.c @@ -72,10 +72,9 @@ static int ipack_bus_remove(struct device *device) struct ipack_device *dev = to_ipack_dev(device); struct ipack_driver *drv = to_ipack_driver(device->driver); - if (!drv->ops->remove) - return -EINVAL; + if (drv->ops->remove) + drv->ops->remove(dev); - drv->ops->remove(dev); return 0; }