2022-12-02 17:07:07

by Ricardo Ribalda

[permalink] [raw]
Subject: [PATCH v2] 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 <[email protected]>
---
media: i2c: ad5280: Fix error path

While revieweing dev_err_probe() series I found something weird,
lets try to fix it.

To: Pavel Machek <[email protected]>
To: Sakari Ailus <[email protected]>
To: Mauro Carvalho Chehab <[email protected]>
To: Pali Rohar <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
Changes in v2:
- Rebase on top of linux-master
- Remove non-ascii chars from To:
- Link to v1: https://lore.kernel.org/r/[email protected]
---
drivers/media/i2c/ad5820.c | 10 +++++-----
1 file 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;
}


---
base-commit: a4412fdd49dc011bcc2c0d81ac4cab7457092650
change-id: 20220921-ad5820-73d40ca9f707

Best regards,
--
Ricardo Ribalda <[email protected]>


2022-12-05 10:37:18

by Sakari Ailus

[permalink] [raw]
Subject: Re: [PATCH v2] media: i2c: ad5820: Fix error path

Hi Ricardo,

On Fri, Dec 02, 2022 at 05:35:59PM +0100, Ricardo Ribalda wrote:
> 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 <[email protected]>

I'm afraid v1 has already been merged. But I understand patch content
wasn't really different so that should be fine.

--
Kind regards,

Sakari Ailus

2022-12-05 10:50:08

by Ricardo Ribalda

[permalink] [raw]
Subject: Re: [PATCH v2] media: i2c: ad5820: Fix error path

On Mon, 5 Dec 2022 at 10:58, Sakari Ailus <[email protected]> wrote:
>
> Hi Ricardo,
>
> On Fri, Dec 02, 2022 at 05:35:59PM +0100, Ricardo Ribalda wrote:
> > 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 <[email protected]>
>
> I'm afraid v1 has already been merged. But I understand patch content
> wasn't really different so that should be fine.

Sorry I missed that :)

Thanks!


>
> --
> Kind regards,
>
> Sakari Ailus



--
Ricardo Ribalda