aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Reichel <sre@kernel.org>2013-10-06 14:23:49 -0400
committerSebastian Reichel <sre@kernel.org>2014-05-15 18:54:29 -0400
commita0bf37edb4d34c21bdaa19a1624378924b917491 (patch)
tree7581330b69c32686c4f60b2a5eb17ace74c43423
parent84d93b5e605324679cffb6d28c7339dd18165fd4 (diff)
HSI: method to unregister clients from an hsi port
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>
-rw-r--r--drivers/hsi/hsi.c10
-rw-r--r--include/linux/hsi/hsi.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/hsi/hsi.c b/drivers/hsi/hsi.c
index 749f7b5c8179..e96a9874b1a4 100644
--- a/drivers/hsi/hsi.c
+++ b/drivers/hsi/hsi.c
@@ -130,6 +130,16 @@ static void hsi_port_release(struct device *dev)
130} 130}
131 131
132/** 132/**
133 * hsi_unregister_port - Unregister an HSI port
134 * @port: The HSI port to unregister
135 */
136void hsi_port_unregister_clients(struct hsi_port *port)
137{
138 device_for_each_child(&port->device, NULL, hsi_remove_client);
139}
140EXPORT_SYMBOL_GPL(hsi_port_unregister_clients);
141
142/**
133 * hsi_unregister_controller - Unregister an HSI controller 143 * hsi_unregister_controller - Unregister an HSI controller
134 * @hsi: The HSI controller to register 144 * @hsi: The HSI controller to register
135 */ 145 */
diff --git a/include/linux/hsi/hsi.h b/include/linux/hsi/hsi.h
index 39bfd5b89077..5a9f1210ed22 100644
--- a/include/linux/hsi/hsi.h
+++ b/include/linux/hsi/hsi.h
@@ -282,6 +282,7 @@ struct hsi_controller *hsi_alloc_controller(unsigned int n_ports, gfp_t flags);
282void hsi_put_controller(struct hsi_controller *hsi); 282void hsi_put_controller(struct hsi_controller *hsi);
283int hsi_register_controller(struct hsi_controller *hsi); 283int hsi_register_controller(struct hsi_controller *hsi);
284void hsi_unregister_controller(struct hsi_controller *hsi); 284void hsi_unregister_controller(struct hsi_controller *hsi);
285void hsi_port_unregister_clients(struct hsi_port *port);
285 286
286static inline void hsi_controller_set_drvdata(struct hsi_controller *hsi, 287static inline void hsi_controller_set_drvdata(struct hsi_controller *hsi,
287 void *data) 288 void *data)