Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <uwe@kleine-koenig.org>
Acked-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Link: https://lore.kernel.org/r/20210207215556.96371-2-uwe@kleine-koenig.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Uwe Kleine-König and committed by
Greg Kroah-Hartman
609cf09c c31d32ba

+2 -3
+2 -3
drivers/ipack/ipack.c
··· 72 72 struct ipack_device *dev = to_ipack_dev(device); 73 73 struct ipack_driver *drv = to_ipack_driver(device->driver); 74 74 75 - if (!drv->ops->remove) 76 - return -EINVAL; 75 + if (drv->ops->remove) 76 + drv->ops->remove(dev); 77 77 78 - drv->ops->remove(dev); 79 78 return 0; 80 79 } 81 80