Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 378051f3 authored by Shankar Ravi's avatar Shankar Ravi Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: sensor: unregister cci subdev if registration fails



If the CPAS registration is failed, subdev need to be unregistered so that
subdev list entry will not become NULL and other subdev can
be added.

Change-Id: I9bf605bef5e125620ce9ba773c040ab7c5995337
Signed-off-by: default avatarShankar Ravi <rshankar@codeaurora.org>
parent 0c999fe8
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -442,13 +442,15 @@ static int cam_cci_platform_probe(struct platform_device *pdev)
	rc = cam_cpas_register_client(&cpas_parms);
	if (rc) {
		CAM_ERR(CAM_CCI, "CPAS registration failed");
		goto cci_no_resource;
		goto cci_unregister_subdev;
	}
	CAM_DBG(CAM_CCI, "CPAS registration successful handle=%d",
		cpas_parms.client_handle);
	new_cci_dev->cpas_handle = cpas_parms.client_handle;

	return rc;
cci_unregister_subdev:
	cam_unregister_subdev(&(new_cci_dev->v4l2_dev_str));
cci_no_resource:
	kfree(new_cci_dev);
	return rc;