summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus
diff options
context:
space:
mode:
authorAlexandre Bailon <abailon@baylibre.com>2017-03-26 18:58:23 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-18 13:27:15 +0200
commit2e2fd6be427547143356a3f0faf1e5247c86c6a0 (patch)
tree288e5caad71152353fd7795d3fd4be329a322e3f /drivers/staging/greybus
parent4064771da8d10118075abdcd4b1c70144ac975b7 (diff)
staging: greybus: make cport_quiesce() method optional
The cport_quiesce() method is mandatory in the case of the es2 Greybus hd controller to shutdown the cports on the es2 controller. In order to add support of another controller which may not need to shutdown its cports, make the cport_quiesce() optional, and check if the controller implement it before to use it. Signed-off-by: Alexandre Bailon <abailon@baylibre.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/greybus')
-rw-r--r--drivers/staging/greybus/connection.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c
index 1bf0ee403106..2cf64640e8ec 100644
--- a/drivers/staging/greybus/connection.c
+++ b/drivers/staging/greybus/connection.c
@@ -366,6 +366,9 @@ static int gb_connection_hd_cport_quiesce(struct gb_connection *connection)
if (connection->mode_switch)
peer_space += sizeof(struct gb_operation_msg_hdr);
+ if (!hd->driver->cport_quiesce)
+ return 0;
+
ret = hd->driver->cport_quiesce(hd, connection->hd_cport_id,
peer_space,
GB_CONNECTION_CPORT_QUIESCE_TIMEOUT);