From: Johan Hovold Date: Wed, 30 Dec 2015 10:23:51 +0000 (+0100) Subject: greybus: camera: destroy data connection on link-config errors X-Git-Tag: v5.15~12752^2~378^2~21^2~886 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=41c23958557d9b37755768849ee39b99a9826a9c;p=platform%2Fkernel%2Flinux-starfive.git greybus: camera: destroy data connection on link-config errors Make sure to tear down the data connection also on failure to configure the link by setting the data_connected flag immediately after creating the connection. Signed-off-by: Johan Hovold Reviewed-by: Laurent Pinchart Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/camera.c b/drivers/staging/greybus/camera.c index ec7d4a0..b181ac4 100644 --- a/drivers/staging/greybus/camera.c +++ b/drivers/staging/greybus/camera.c @@ -604,6 +604,8 @@ static int gb_camera_connection_init(struct gb_connection *connection) if (ret < 0) goto error; + gcam->data_connected = true; + ret = gb_svc_link_config(svc, connection->intf->interface_id, GB_SVC_LINK_CONFIG_BURST_HS_A, 2, 2, 0); if (ret < 0) @@ -614,8 +616,6 @@ static int gb_camera_connection_init(struct gb_connection *connection) if (ret < 0) goto error; - gcam->data_connected = true; - ret = gb_camera_debugfs_init(gcam); if (ret < 0) goto error;