summaryrefslogtreecommitdiffstats
path: root/drivers/vme
diff options
context:
space:
mode:
authorStefano Babic <sbabic@denx.de>2017-01-20 10:38:20 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-25 05:41:44 -0500
commit9797484ba83d68f18fe1cbd964b7cd830f78f0f7 (patch)
treea09aea363332e4db07c6fe439a787daea069b9aa /drivers/vme
parent9ba60573638e2006170ebcc5489fb1e068afbc8f (diff)
VME: restore bus_remove function causing incomplete module unload
Commit 050c3d52cc7810d9d17b8cd231708609af6876ae ("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: 050c3d52cc78 ("vme: make core vme support explicitly non-modular") Cc: Manohar Vanga <manohar.vanga@gmail.com> Acked-by: Martyn Welch <martyn@welchs.me.uk> Cc: devel@driverdev.osuosl.org Signed-off-by: Stefano Babic <sbabic@denx.de> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: stable <stable@vger.kernel.org> # 4.9 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/vme')
-rw-r--r--drivers/vme/vme.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/vme/vme.c b/drivers/vme/vme.c
index bdbadaa47ef3..0035cf79760a 100644
--- a/drivers/vme/vme.c
+++ b/drivers/vme/vme.c
@@ -1625,10 +1625,25 @@ static int vme_bus_probe(struct device *dev)
1625 return retval; 1625 return retval;
1626} 1626}
1627 1627
1628static int vme_bus_remove(struct device *dev)
1629{
1630 int retval = -ENODEV;
1631 struct vme_driver *driver;
1632 struct vme_dev *vdev = dev_to_vme_dev(dev);
1633
1634 driver = dev->platform_data;
1635
1636 if (driver->remove != NULL)
1637 retval = driver->remove(vdev);
1638
1639 return retval;
1640}
1641
1628struct bus_type vme_bus_type = { 1642struct bus_type vme_bus_type = {
1629 .name = "vme", 1643 .name = "vme",
1630 .match = vme_bus_match, 1644 .match = vme_bus_match,
1631 .probe = vme_bus_probe, 1645 .probe = vme_bus_probe,
1646 .remove = vme_bus_remove,
1632}; 1647};
1633EXPORT_SYMBOL(vme_bus_type); 1648EXPORT_SYMBOL(vme_bus_type);
1634 1649