aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUmang Jain <[email protected]>2024-03-21 18:37:36 +0530
committerGreg Kroah-Hartman <[email protected]>2024-03-25 19:09:19 +0100
commitbf1894900b53f9047eb9b96c89717a9a22329f6a (patch)
tree8651a9a7358adde29720f37a1b0f4e9e6b0cf37c
parentff6643de78d12d9174d574b25794f8ab4b8c5ac6 (diff)
staging: vc04_services: Implement vchiq_bus .remove
Implement the struct vchiq_bus .remove() so that cleanup paths can be executed by the devices registered to this bus, when being removed. Signed-off-by: Umang Jain <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
index 68f830d75531..93609716df84 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
@@ -37,11 +37,21 @@ static int vchiq_bus_probe(struct device *dev)
return driver->probe(device);
}
+static void vchiq_bus_remove(struct device *dev)
+{
+ struct vchiq_device *device = to_vchiq_device(dev);
+ struct vchiq_driver *driver = to_vchiq_driver(dev->driver);
+
+ if (driver->remove)
+ driver->remove(device);
+}
+
const struct bus_type vchiq_bus_type = {
.name = "vchiq-bus",
.match = vchiq_bus_type_match,
.uevent = vchiq_bus_uevent,
.probe = vchiq_bus_probe,
+ .remove = vchiq_bus_remove,
};
static void vchiq_device_release(struct device *dev)