Skip to content

Commit

Permalink
media: i2c: ad5820: Fix error path
Browse files Browse the repository at this point in the history
Error path seems to be swaped. Fix the order and provide some meaningful
names.

Fixes: bee3d51 ("[media] ad5820: Add driver for auto-focus coil")
Signed-off-by: Ricardo Ribalda <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
  • Loading branch information
ribalda authored and Sakari Ailus committed Oct 25, 2022
1 parent 9084e2c commit 9fce241
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/media/i2c/ad5820.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 9fce241

Please sign in to comment.