summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Ribalda <ribalda@chromium.org>2022-09-21 13:38:00 +0200
committerSakari Ailus <sakari.ailus@linux.intel.com>2022-10-25 09:37:04 +0200
commit9fce241660f37d9e95e93c0ae6fba8cfefa5797b (patch)
treecb3098b153abb1af094bc2263d7b234bdeab7c0f
parentmedia: i2c: ov5645: Drop fetching the clk reference by name (diff)
downloadlinux-9fce241660f37d9e95e93c0ae6fba8cfefa5797b.tar.xz
linux-9fce241660f37d9e95e93c0ae6fba8cfefa5797b.zip
media: i2c: ad5820: Fix error path
Error path seems to be swaped. Fix the order and provide some meaningful names. Fixes: bee3d5115611 ("[media] ad5820: Add driver for auto-focus coil") Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
-rw-r--r--drivers/media/i2c/ad5820.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/media/i2c/ad5820.c b/drivers/media/i2c/ad5820.c
index 516de278cc49..a12fedcc3a1c 100644
--- a/drivers/media/i2c/ad5820.c
+++ b/drivers/media/i2c/ad5820.c
@@ -327,18 +327,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;
}