greybus: camera: Clean up when AP link power mode configuration failed
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Sun, 14 Feb 2016 00:33:05 +0000 (02:33 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Mon, 15 Feb 2016 22:55:17 +0000 (14:55 -0800)
Restore the module link power mode to the previous state in that case.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Gjorgji Rosikopulos <grosikopulos@mm-sol.com>
Tested-by: Jacopo Mondi <jacopo.mondi@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/camera.c

index 8383770910c59bfd65867f5769a81e86106e6464..25dbf690e1fcaaa9159b830186f24cc68f5bcd23 100644 (file)
@@ -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;