HSI: method to unregister clients from an hsi port
authorSebastian Reichel <sre@kernel.org>
Sun, 6 Oct 2013 18:23:49 +0000 (20:23 +0200)
committerSebastian Reichel <sre@kernel.org>
Thu, 15 May 2014 22:54:29 +0000 (00:54 +0200)
This exports a method to unregister all clients from
an hsi port.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
Tested-By: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
drivers/hsi/hsi.c
include/linux/hsi/hsi.h

index 749f7b5c81795e6244c2cdc14abc7683919032c3..e96a9874b1a42ecd5ff836718f8bf4f184977065 100644 (file)
@@ -129,6 +129,16 @@ static void hsi_port_release(struct device *dev)
        kfree(to_hsi_port(dev));
 }
 
+/**
+ * hsi_unregister_port - Unregister an HSI port
+ * @port: The HSI port to unregister
+ */
+void hsi_port_unregister_clients(struct hsi_port *port)
+{
+       device_for_each_child(&port->device, NULL, hsi_remove_client);
+}
+EXPORT_SYMBOL_GPL(hsi_port_unregister_clients);
+
 /**
  * hsi_unregister_controller - Unregister an HSI controller
  * @hsi: The HSI controller to register
index 39bfd5b8907775b629c985f0fe98df7167ca3008..5a9f1210ed2214ef322a09ce650ba983249985c4 100644 (file)
@@ -282,6 +282,7 @@ struct hsi_controller *hsi_alloc_controller(unsigned int n_ports, gfp_t flags);
 void hsi_put_controller(struct hsi_controller *hsi);
 int hsi_register_controller(struct hsi_controller *hsi);
 void hsi_unregister_controller(struct hsi_controller *hsi);
+void hsi_port_unregister_clients(struct hsi_port *port);
 
 static inline void hsi_controller_set_drvdata(struct hsi_controller *hsi,
                                                                void *data)