From: Laurent Pinchart Date: Sun, 14 Feb 2016 00:33:05 +0000 (+0200) Subject: greybus: camera: Clean up when AP link power mode configuration failed X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b573b0e65616c1ae5c5dd2c14fd62d3ded3d5466;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git greybus: camera: Clean up when AP link power mode configuration failed Restore the module link power mode to the previous state in that case. Signed-off-by: Laurent Pinchart Reviewed-by: Gjorgji Rosikopulos Tested-by: Jacopo Mondi Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/camera.c b/drivers/staging/greybus/camera.c index 8383770910c5..25dbf690e1fc 100644 --- a/drivers/staging/greybus/camera.c +++ b/drivers/staging/greybus/camera.c @@ -147,6 +147,7 @@ static int gb_camera_set_power_mode(struct gb_camera *gcam, bool hs) ret = gb_camera_set_intf_power_mode(gcam, svc->ap_intf_id, hs); if (ret < 0) { + gb_camera_set_intf_power_mode(gcam, intf->interface_id, !hs); gcam_err(gcam, "failed to set AP interface to %s (%d)\n", hs ? "HS" : "PWM", ret); return ret;