greybus: pm: add error handling to bundle activation
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Thu, 21 Jul 2016 16:09:34 +0000 (18:09 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 22 Jul 2016 01:54:11 +0000 (18:54 -0700)
The firmware now keeps the underlying hardware disabled until
receiving the first Bundle Activate request. Additionally: requesting
transition to a state the bundle is already in is no longer an error.

We can now add proper error handling to the bundle activate call.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/core.c

index 8c77d6c..1049e9c 100644 (file)
@@ -181,12 +181,11 @@ static int greybus_probe(struct device *dev)
                return retval;
        }
 
-       /*
-        * FIXME: We need to perform error handling on bundle activate call
-        * below when firmware is ready. We just allow the activate operation to
-        * fail for now since bundle may be in active already.
-        */
-       gb_control_bundle_activate(bundle->intf->control, bundle->id);
+       retval = gb_control_bundle_activate(bundle->intf->control, bundle->id);
+       if (retval) {
+               pm_runtime_put(&bundle->intf->dev);
+               return retval;
+       }
 
        /*
         * Unbound bundle devices are always deactivated. During probe, the