Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

greybus: pm: add error handling to bundle activation

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>

authored by

Bartosz Golaszewski and committed by
Greg Kroah-Hartman
f5c93dea 2358024b

+5 -6
+5 -6
drivers/staging/greybus/core.c
··· 181 181 return retval; 182 182 } 183 183 184 - /* 185 - * FIXME: We need to perform error handling on bundle activate call 186 - * below when firmware is ready. We just allow the activate operation to 187 - * fail for now since bundle may be in active already. 188 - */ 189 - gb_control_bundle_activate(bundle->intf->control, bundle->id); 184 + retval = gb_control_bundle_activate(bundle->intf->control, bundle->id); 185 + if (retval) { 186 + pm_runtime_put(&bundle->intf->dev); 187 + return retval; 188 + } 190 189 191 190 /* 192 191 * Unbound bundle devices are always deactivated. During probe, the