Commit 2e2fd6be authored by Alexandre Bailon's avatar Alexandre Bailon Committed by Greg Kroah-Hartman

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: default avatarAlexandre Bailon <abailon@baylibre.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4064771d
...@@ -366,6 +366,9 @@ static int gb_connection_hd_cport_quiesce(struct gb_connection *connection) ...@@ -366,6 +366,9 @@ static int gb_connection_hd_cport_quiesce(struct gb_connection *connection)
if (connection->mode_switch) if (connection->mode_switch)
peer_space += sizeof(struct gb_operation_msg_hdr); 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, ret = hd->driver->cport_quiesce(hd, connection->hd_cport_id,
peer_space, peer_space,
GB_CONNECTION_CPORT_QUIESCE_TIMEOUT); GB_CONNECTION_CPORT_QUIESCE_TIMEOUT);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment