mirror of
https://github.com/torvalds/linux.git
synced 2024-12-11 13:41:55 +00:00
device-dax: Properly handle drivers without remove callback
If all resources are allocated in .probe() using devm_ functions it might make sense to not provide a .remove() callback. Then the right thing is to just return success. Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org> Link: https://lore.kernel.org/r/20210205222842.34896-3-uwe@kleine-koenig.org Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
parent
5b8e64f1ad
commit
8029968e2a
@ -178,8 +178,12 @@ static int dax_bus_remove(struct device *dev)
|
||||
{
|
||||
struct dax_device_driver *dax_drv = to_dax_drv(dev->driver);
|
||||
struct dev_dax *dev_dax = to_dev_dax(dev);
|
||||
int ret = 0;
|
||||
|
||||
return dax_drv->remove(dev_dax);
|
||||
if (dax_drv->remove)
|
||||
ret = dax_drv->remove(dev_dax);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct bus_type dax_bus_type = {
|
||||
|
Loading…
Reference in New Issue
Block a user