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 @@ -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 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); 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)