Skip to content

Commit

Permalink
ipack: Handle a driver without remove callback
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Samuel Iglesias Gonsalvez <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
ukleinek authored and gregkh committed Feb 9, 2021
1 parent c31d32b commit 609cf09
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/ipack/ipack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 609cf09

Please sign in to comment.