summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/interface.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2016-07-20 17:40:27 +0300
committerGreg Kroah-Hartman <gregkh@google.com>2016-07-20 20:16:54 +0300
commit4f7e413b2d2d2825dbb36b73f06e69514022b132 (patch)
tree56ec9da990c1c43c21a3f7f962cc7343faa6cd98 /drivers/staging/greybus/interface.c
parente21e6bad3f425e8bc74186f3ab1e21cd40f7a208 (diff)
downloadlinux-4f7e413b2d2d2825dbb36b73f06e69514022b132.tar.xz
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: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Alex Elder <elder@linaro.org> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Sandeep Patil <sspatil@google.com> Reviewed-by: Patrick Titiano <ptitiano@baylibre.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/interface.c')
-rw-r--r--drivers/staging/greybus/interface.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/staging/greybus/interface.c b/drivers/staging/greybus/interface.c
index f5ed79c687d2..919eaa0a46c7 100644
--- a/drivers/staging/greybus/interface.c
+++ b/drivers/staging/greybus/interface.c
@@ -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)