Skip to content

Commit

Permalink
HSI: method to unregister clients from an hsi port
Browse files Browse the repository at this point in the history
This exports a method to unregister all clients from
an hsi port.

Signed-off-by: Sebastian Reichel <[email protected]>
Reviewed-by: Pavel Machek <[email protected]>
Tested-By: Ivaylo Dimitrov <[email protected]>
  • Loading branch information
sre committed May 15, 2014
1 parent 84d93b5 commit a0bf37e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/hsi/hsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions include/linux/hsi/hsi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a0bf37e

Please sign in to comment.