Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1562520 > unrolled thread

[PATCH] VME: add again remove entry point

Started byStefano Babic <sbabic@denx.de>
First post2017-01-19 10:40 +0100
Last post2017-01-19 10:40 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] VME: add again remove entry point Stefano Babic <sbabic@denx.de> - 2017-01-19 10:40 +0100

#1562520 — [PATCH] VME: add again remove entry point

FromStefano Babic <sbabic@denx.de>
Date2017-01-19 10:40 +0100
Subject[PATCH] VME: add again remove entry point
Message-ID<t1hmi-8aB-19@gated-at.bofh.it>
Commit 050c3d52cc7 dropped the remove
entry point. However, vme_bus_remove()
is called when a VME device is removed
from the bus and not when the bus is removed
and it calls the VME device driver's cleanup
function.
Without this function, the remove() in VME
device driver is never called and VME device
drivers cannot be reloaded again.

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 drivers/vme/vme.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/vme/vme.c b/drivers/vme/vme.c
index d078fad..ae35d7b 100644
--- a/drivers/vme/vme.c
+++ b/drivers/vme/vme.c
@@ -1737,10 +1737,25 @@ static int vme_bus_probe(struct device *dev)
 	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 = {
 	.name = "vme",
 	.match = vme_bus_match,
 	.probe = vme_bus_probe,
+	.remove = vme_bus_remove,
 };
 EXPORT_SYMBOL(vme_bus_type);
 
-- 
2.7.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web