diff options
author | 2015-09-17 13:17:23 +0200 | |
---|---|---|
committer | 2015-09-17 14:33:07 -0700 | |
commit | 72d748226379979e4a2e3e1ebf5379fa57f6f3fe (patch) | |
tree | c495bff03b749f0fa61558520aab83e8e05edd98 /drivers/staging/greybus/connection.c | |
parent | greybus: connection: clean up init error paths (diff) | |
download | linux-72d748226379979e4a2e3e1ebf5379fa57f6f3fe.tar.gz linux-72d748226379979e4a2e3e1ebf5379fa57f6f3fe.tar.bz2 linux-72d748226379979e4a2e3e1ebf5379fa57f6f3fe.zip |
greybus: connection: clean up control-disconnected helper
Rename helper to the more descriptive
gb_connection_control_disconnected().
Use u16 for cport number, remove redundant cport number from warning
message, and shorten a long line.
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/connection.c')
-rw-r--r-- | drivers/staging/greybus/connection.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c index 5b8aa04a9f15..ac787923b2d7 100644 --- a/drivers/staging/greybus/connection.c +++ b/drivers/staging/greybus/connection.c @@ -368,22 +368,25 @@ gb_connection_svc_connection_destroy(struct gb_connection *connection) connection->intf_cport_id); } -static void gb_connection_disconnected(struct gb_connection *connection) +/* Inform Interface about inactive CPorts */ +static void +gb_connection_control_disconnected(struct gb_connection *connection) { + struct gb_protocol *protocol = connection->protocol; struct gb_control *control; - int cport_id = connection->intf_cport_id; + u16 cport_id = connection->intf_cport_id; int ret; - /* Inform Interface about inactive CPorts */ - if (connection->protocol->flags & GB_PROTOCOL_SKIP_CONTROL_DISCONNECTED) + if (protocol->flags & GB_PROTOCOL_SKIP_CONTROL_DISCONNECTED) return; control = connection->bundle->intf->control; ret = gb_control_disconnected_operation(control, cport_id); - if (ret) + if (ret) { dev_warn(&connection->dev, - "Failed to disconnect CPort-%d (%d)\n", cport_id, ret); + "failed to disconnect cport: %d\n", ret); + } } static int gb_connection_init(struct gb_connection *connection) @@ -439,7 +442,7 @@ err_disconnect: connection->state = GB_CONNECTION_STATE_ERROR; spin_unlock_irq(&connection->lock); - gb_connection_disconnected(connection); + gb_connection_control_disconnected(connection); err_svc_destroy: gb_connection_svc_connection_destroy(connection); @@ -462,7 +465,7 @@ static void gb_connection_exit(struct gb_connection *connection) gb_connection_cancel_operations(connection, -ESHUTDOWN); connection->protocol->connection_exit(connection); - gb_connection_disconnected(connection); + gb_connection_control_disconnected(connection); gb_connection_svc_connection_destroy(connection); } |