diff options
author | Dan Williams <dan.j.williams@intel.com> | 2016-05-21 21:33:04 +0200 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2016-05-21 21:33:04 +0200 |
commit | 36092ee8ba695fce023b2118ececa6c2a56b1331 (patch) | |
tree | b9579893cdd559e7b72fa569003b19792de58fad /drivers/nvdimm/bus.c | |
parent | Merge branch 'for-4.7/acpi6.1' into libnvdimm-for-next (diff) | |
parent | libnvdimm, dax: fix deletion (diff) | |
download | linux-36092ee8ba695fce023b2118ececa6c2a56b1331.tar.xz linux-36092ee8ba695fce023b2118ececa6c2a56b1331.zip |
Merge branch 'for-4.7/dax' into libnvdimm-for-next
Diffstat (limited to 'drivers/nvdimm/bus.c')
-rw-r--r-- | drivers/nvdimm/bus.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c index 04c2c3fda1ab..f085f8bceae8 100644 --- a/drivers/nvdimm/bus.c +++ b/drivers/nvdimm/bus.c @@ -124,9 +124,10 @@ static int nvdimm_bus_remove(struct device *dev) struct nd_device_driver *nd_drv = to_nd_device_driver(dev->driver); struct module *provider = to_bus_provider(dev); struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(dev); - int rc; + int rc = 0; - rc = nd_drv->remove(dev); + if (nd_drv->remove) + rc = nd_drv->remove(dev); nd_region_disable(nvdimm_bus, dev); dev_dbg(&nvdimm_bus->dev, "%s.remove(%s) = %d\n", dev->driver->name, @@ -296,8 +297,8 @@ int __nd_driver_register(struct nd_device_driver *nd_drv, struct module *owner, return -EINVAL; } - if (!nd_drv->probe || !nd_drv->remove) { - pr_debug("->probe() and ->remove() must be specified\n"); + if (!nd_drv->probe) { + pr_debug("%s ->probe() must be specified\n", mod_name); return -EINVAL; } |