Commit 9797484b authored by Stefano Babic's avatar Stefano Babic Committed by Greg Kroah-Hartman

VME: restore bus_remove function causing incomplete module unload

Commit 050c3d52 ("vme: make core
vme support explicitly non-modular") dropped the remove function
because it appeared as if it was for removal of the bus, which is
not supported.

However, vme_bus_remove() is called when a VME device is removed
from the bus and not when the bus is removed; as it calls the VME
device driver's cleanup function.  Without this function, the
remove() in the VME device driver is never called and VME device
drivers cannot be reloaded again.

Here we restore the remove function that was deleted in that
commit, and the reference to the function in the bus structure.

Fixes: 050c3d52 ("vme: make core vme support explicitly non-modular")
Cc: Manohar Vanga <manohar.vanga@gmail.com>
Acked-by: default avatarMartyn Welch <martyn@welchs.me.uk>
Cc: devel@driverdev.osuosl.org
Signed-off-by: default avatarStefano Babic <sbabic@denx.de>
Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
Cc: stable <stable@vger.kernel.org> # 4.9
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9ba60573
...@@ -1625,10 +1625,25 @@ static int vme_bus_probe(struct device *dev) ...@@ -1625,10 +1625,25 @@ static int vme_bus_probe(struct device *dev)
return retval; return retval;
} }
static int vme_bus_remove(struct device *dev)
{
int retval = -ENODEV;
struct vme_driver *driver;
struct vme_dev *vdev = dev_to_vme_dev(dev);
driver = dev->platform_data;
if (driver->remove != NULL)
retval = driver->remove(vdev);
return retval;
}
struct bus_type vme_bus_type = { struct bus_type vme_bus_type = {
.name = "vme", .name = "vme",
.match = vme_bus_match, .match = vme_bus_match,
.probe = vme_bus_probe, .probe = vme_bus_probe,
.remove = vme_bus_remove,
}; };
EXPORT_SYMBOL(vme_bus_type); EXPORT_SYMBOL(vme_bus_type);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment