summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/module.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2016-07-20 14:40:22 (GMT)
committerGreg Kroah-Hartman <gregkh@google.com>2016-07-20 17:16:54 (GMT)
commit3e93cb6abbc023aebf311618481263e000bf26fb (patch)
treea40c0f73179ca0fea48971faaf220918ca45846c /drivers/staging/greybus/module.c
parent27b9e257dd57fba0d63d996bf050fcbd94d998d7 (diff)
downloadlinux-3e93cb6abbc023aebf311618481263e000bf26fb.tar.xz
greybus: interface: clean up ES3 activation-retry hack
Clean up the ES3 activation retry-hack and isolate it in the interface code. This way the retry hack can be reused when we soon start allowing interfaces to be reactivated after having been powered down. Reviewed-by: Sandeep Patil <sspatil@google.com> 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: Patrick Titiano <ptitiano@baylibre.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/module.c')
-rw-r--r--drivers/staging/greybus/module.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/drivers/staging/greybus/module.c b/drivers/staging/greybus/module.c
index 3ae5876..d506fa0 100644
--- a/drivers/staging/greybus/module.c
+++ b/drivers/staging/greybus/module.c
@@ -143,15 +143,10 @@ static void gb_module_register_interface(struct gb_interface *intf)
struct gb_module *module = intf->module;
u8 intf_id = intf->interface_id;
int ret;
- int retries = 3;
mutex_lock(&intf->mutex);
- while (retries--) {
- ret = gb_interface_activate(intf);
- if (ret != -EAGAIN)
- break;
- }
+ ret = gb_interface_activate(intf);
if (ret) {
if (intf->type != GB_INTERFACE_TYPE_DUMMY) {
dev_err(&module->dev,
@@ -159,19 +154,6 @@ static void gb_module_register_interface(struct gb_interface *intf)
intf_id, ret);
}
- /*
- * -EAGAIN indicates that the Greybus operation
- * interface_activate determined the remote interface to be
- * UniPro-only. At present, we assume a UniPro-only module
- * to be a Greybus module that failed to send its mailbox
- * poke. There is some reason to believe that this is
- * because of a bug in the ES3 bootrom. If we exhause our
- * retries trying to activate such an interface, convert
- * the error code back into a "no device" error.
- */
- if (ret == -EAGAIN)
- ret = -ENODEV;
-
gb_interface_add(intf);
goto err_unlock;
}