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

Commit 3f2384f0 authored by Ricardo Ribalda's avatar Ricardo Ribalda Committed by Greg Kroah-Hartman
Browse files

media: i2c: ad5820: Fix error path



[ Upstream commit 9fce241660f37d9e95e93c0ae6fba8cfefa5797b ]

Error path seems to be swaped. Fix the order and provide some meaningful
names.

Fixes: bee3d511 ("[media] ad5820: Add driver for auto-focus coil")
Signed-off-by: default avatarRicardo Ribalda <ribalda@chromium.org>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent e8e2da03
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -314,18 +314,18 @@ static int ad5820_probe(struct i2c_client *client,

	ret = media_entity_pads_init(&coil->subdev.entity, 0, NULL);
	if (ret < 0)
		goto cleanup2;
		goto clean_mutex;

	ret = v4l2_async_register_subdev(&coil->subdev);
	if (ret < 0)
		goto cleanup;
		goto clean_entity;

	return ret;

cleanup2:
	mutex_destroy(&coil->power_lock);
cleanup:
clean_entity:
	media_entity_cleanup(&coil->subdev.entity);
clean_mutex:
	mutex_destroy(&coil->power_lock);
	return ret;
}