Commit 9fce2416 authored by Ricardo Ribalda's avatar Ricardo Ribalda Committed by Sakari Ailus

media: i2c: ad5820: Fix error path

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>
parent 9084e2c8
...@@ -327,18 +327,18 @@ static int ad5820_probe(struct i2c_client *client, ...@@ -327,18 +327,18 @@ static int ad5820_probe(struct i2c_client *client,
ret = media_entity_pads_init(&coil->subdev.entity, 0, NULL); ret = media_entity_pads_init(&coil->subdev.entity, 0, NULL);
if (ret < 0) if (ret < 0)
goto cleanup2; goto clean_mutex;
ret = v4l2_async_register_subdev(&coil->subdev); ret = v4l2_async_register_subdev(&coil->subdev);
if (ret < 0) if (ret < 0)
goto cleanup; goto clean_entity;
return ret; return ret;
cleanup2: clean_entity:
mutex_destroy(&coil->power_lock);
cleanup:
media_entity_cleanup(&coil->subdev.entity); media_entity_cleanup(&coil->subdev.entity);
clean_mutex:
mutex_destroy(&coil->power_lock);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment