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

Commit 80a1f95b authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab
Browse files

media: ov7740: Fix control handler error at the end of control init



Check that no error happened during adding controls to the driver's
control handler. Print an error message and bail out if there was one.

Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent bad04a55
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1006,6 +1006,13 @@ static int ov7740_init_controls(struct ov7740 *ov7740)
			       V4L2_EXPOSURE_MANUAL, false);
	v4l2_ctrl_cluster(2, &ov7740->hflip);

	if (ctrl_hdlr->error) {
		ret = ctrl_hdlr->error;
		dev_err(&client->dev, "controls initialisation failed (%d)\n",
			ret);
		goto error;
	}

	ret = v4l2_ctrl_handler_setup(ctrl_hdlr);
	if (ret) {
		dev_err(&client->dev, "%s control init failed (%d)\n",