aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/connection.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2016-05-27 17:26:25 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2016-05-27 12:19:29 -0700
commitaca7aab39aa2d69d0a5b1cfc9319506b7c26b79d (patch)
tree4dc3e91a26cdd335d578971233899a35ba607961 /drivers/staging/greybus/connection.c
parentgreybus: interface: avoid I/O to bootrom during removal (diff)
downloadlinux-dev-aca7aab39aa2d69d0a5b1cfc9319506b7c26b79d.tar.xz
linux-dev-aca7aab39aa2d69d0a5b1cfc9319506b7c26b79d.zip
greybus: connection: add control connection flag
Add control connection flag which will be set for control connections. Also add a helper function to test if the flag is set. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> 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.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c
index 7e07ef832b7c..2da713ca7fea 100644
--- a/drivers/staging/greybus/connection.c
+++ b/drivers/staging/greybus/connection.c
@@ -227,7 +227,8 @@ gb_connection_create_static(struct gb_host_device *hd, u16 hd_cport_id,
struct gb_connection *
gb_connection_create_control(struct gb_interface *intf)
{
- return _gb_connection_create(intf->hd, -1, intf, NULL, 0, NULL, 0);
+ return _gb_connection_create(intf->hd, -1, intf, NULL, 0, NULL,
+ GB_CONNECTION_FLAG_CONTROL);
}
struct gb_connection *
@@ -412,11 +413,11 @@ static int gb_connection_control_connected(struct gb_connection *connection)
return 0;
}
- control = connection->intf->control;
-
- if (connection == control->connection)
+ if (gb_connection_is_control(connection))
return 0;
+ control = connection->intf->control;
+
ret = gb_control_connected_operation(control, cport_id);
if (ret) {
dev_err(&connection->bundle->dev,
@@ -438,11 +439,11 @@ gb_connection_control_disconnected(struct gb_connection *connection)
if (gb_connection_is_static(connection))
return;
- control = connection->intf->control;
-
- if (connection == control->connection)
+ if (gb_connection_is_control(connection))
return;
+ control = connection->intf->control;
+
ret = gb_control_disconnected_operation(control, cport_id);
if (ret) {
dev_warn(&connection->bundle->dev,