Commit 4f7e413b authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

greybus: interface: hibernate UniPro link in activation error path

To be well-behaved, we should hibernate the link before disabling UniPro
in case the link has already been established (i.e. when the interface
type has been detected as UniPro or Greybus).
Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Reviewed-by: default avatarAlex Elder <elder@linaro.org>
Reviewed-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: default avatarSandeep Patil <sspatil@google.com>
Reviewed-by: default avatarPatrick Titiano <ptitiano@baylibre.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent e21e6bad
......@@ -947,8 +947,15 @@ static int _gb_interface_activate(struct gb_interface *intf,
goto err_refclk_disable;
ret = gb_interface_activate_operation(intf, type);
if (ret)
goto err_unipro_disable;
if (ret) {
switch (*type) {
case GB_INTERFACE_TYPE_UNIPRO:
case GB_INTERFACE_TYPE_GREYBUS:
goto err_hibernate_link;
default:
goto err_unipro_disable;
}
}
ret = gb_interface_read_dme(intf);
if (ret)
......
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