diff options
author | Johan Hovold <johan@hovoldconsulting.com> | 2016-01-19 12:51:12 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-01-19 12:17:13 -0800 |
commit | bc3be1705c17e05c4d423a67a49a9f316d235bf4 (patch) | |
tree | 8d9080aaf17d7710b8ab73db24abb5005582c1ba /drivers/staging/greybus/connection.c | |
parent | 3e1b8c753d982bd4a63b0896a4ea68888f47502e (diff) |
greybus: connection: remove skip-connected legacy protocol flags
Remove the legacy protocol flags that were used to suppress the
connected and disconnected events.
Instead send the connected and disconnected event for all bundle
connections and explicitly exclude static connections and control
connections.
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.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c index c3207c828a45..3f644ca8759e 100644 --- a/drivers/staging/greybus/connection.c +++ b/drivers/staging/greybus/connection.c @@ -295,15 +295,17 @@ gb_connection_svc_connection_destroy(struct gb_connection *connection) /* Inform Interface about active CPorts */ static int gb_connection_control_connected(struct gb_connection *connection) { - struct gb_protocol *protocol = connection->protocol; struct gb_control *control; u16 cport_id = connection->intf_cport_id; int ret; - if (protocol->flags & GB_PROTOCOL_SKIP_CONTROL_CONNECTED) + if (gb_connection_is_static(connection)) return 0; - control = connection->bundle->intf->control; + control = connection->intf->control; + + if (connection == control->connection) + return 0; ret = gb_control_connected_operation(control, cport_id); if (ret) { @@ -319,15 +321,17 @@ static int gb_connection_control_connected(struct gb_connection *connection) static void gb_connection_control_disconnected(struct gb_connection *connection) { - struct gb_protocol *protocol = connection->protocol; struct gb_control *control; u16 cport_id = connection->intf_cport_id; int ret; - if (protocol->flags & GB_PROTOCOL_SKIP_CONTROL_DISCONNECTED) + if (gb_connection_is_static(connection)) return; - control = connection->bundle->intf->control; + control = connection->intf->control; + + if (connection == control->connection) + return; ret = gb_control_disconnected_operation(control, cport_id); if (ret) { |