diff mbox series

[v2] media: i2c: rdacm2x: properly set subdev entity function

Message ID 20220309115507.30019-1-laurentiu.palcu@oss.nxp.com (mailing list archive)
State New, archived
Headers show
Series [v2] media: i2c: rdacm2x: properly set subdev entity function | expand

Commit Message

Laurentiu Palcu March 9, 2022, 11:55 a.m. UTC
The subdevice entity function was left unset, which produces a warning
when probing the device:

mxc-md bus@58000000:camera: Entity type for entity rdacm20 19-0051 was
not initialized!

This patch will set entity function to MEDIA_ENT_F_CAM_SENSOR and leave
flags unset.

Fixes: 34009bffc1c6 ("media: i2c: Add RDACM20 driver")
Fixes: a59f853b3b4b ("media: i2c: Add driver for RDACM21 camera module")
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
---
Changes in v2:
	* leave entity flags unset;

Cheers,
Laurentiu

 drivers/media/i2c/rdacm20.c | 2 +-
 drivers/media/i2c/rdacm21.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Jacopo Mondi March 9, 2022, 1:50 p.m. UTC | #1
Hi Laurentiu

On Wed, Mar 09, 2022 at 01:55:06PM +0200, Laurentiu Palcu wrote:
> The subdevice entity function was left unset, which produces a warning
> when probing the device:
>
> mxc-md bus@58000000:camera: Entity type for entity rdacm20 19-0051 was
> not initialized!
>
> This patch will set entity function to MEDIA_ENT_F_CAM_SENSOR and leave
> flags unset.
>
> Fixes: 34009bffc1c6 ("media: i2c: Add RDACM20 driver")
> Fixes: a59f853b3b4b ("media: i2c: Add driver for RDACM21 camera module")
> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>

Thanks!

Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>

> ---
> Changes in v2:
> 	* leave entity flags unset;
>
> Cheers,
> Laurentiu
>
>  drivers/media/i2c/rdacm20.c | 2 +-
>  drivers/media/i2c/rdacm21.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/i2c/rdacm20.c b/drivers/media/i2c/rdacm20.c
> index 025a610de893..9c6f66cab564 100644
> --- a/drivers/media/i2c/rdacm20.c
> +++ b/drivers/media/i2c/rdacm20.c
> @@ -611,7 +611,7 @@ static int rdacm20_probe(struct i2c_client *client)
>  		goto error_free_ctrls;
>
>  	dev->pad.flags = MEDIA_PAD_FL_SOURCE;
> -	dev->sd.entity.flags |= MEDIA_ENT_F_CAM_SENSOR;
> +	dev->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
>  	ret = media_entity_pads_init(&dev->sd.entity, 1, &dev->pad);
>  	if (ret < 0)
>  		goto error_free_ctrls;
> diff --git a/drivers/media/i2c/rdacm21.c b/drivers/media/i2c/rdacm21.c
> index 12ec5467ed1e..ef31cf5f23ca 100644
> --- a/drivers/media/i2c/rdacm21.c
> +++ b/drivers/media/i2c/rdacm21.c
> @@ -583,7 +583,7 @@ static int rdacm21_probe(struct i2c_client *client)
>  		goto error_free_ctrls;
>
>  	dev->pad.flags = MEDIA_PAD_FL_SOURCE;
> -	dev->sd.entity.flags |= MEDIA_ENT_F_CAM_SENSOR;
> +	dev->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
>  	ret = media_entity_pads_init(&dev->sd.entity, 1, &dev->pad);
>  	if (ret < 0)
>  		goto error_free_ctrls;
> --
> 2.17.1
>
Kieran Bingham March 9, 2022, 3:04 p.m. UTC | #2
Quoting Laurentiu Palcu (2022-03-09 11:55:06)
> The subdevice entity function was left unset, which produces a warning
> when probing the device:
> 
> mxc-md bus@58000000:camera: Entity type for entity rdacm20 19-0051 was
> not initialized!
> 
> This patch will set entity function to MEDIA_ENT_F_CAM_SENSOR and leave
> flags unset.
> 
> Fixes: 34009bffc1c6 ("media: i2c: Add RDACM20 driver")
> Fixes: a59f853b3b4b ("media: i2c: Add driver for RDACM21 camera module")

Ohh, I've never seen a use case for two fixes tags before.
I don't think this requires two patches to implement the fix though.

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
> ---
> Changes in v2:
>         * leave entity flags unset;
> 
> Cheers,
> Laurentiu
> 
>  drivers/media/i2c/rdacm20.c | 2 +-
>  drivers/media/i2c/rdacm21.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/i2c/rdacm20.c b/drivers/media/i2c/rdacm20.c
> index 025a610de893..9c6f66cab564 100644
> --- a/drivers/media/i2c/rdacm20.c
> +++ b/drivers/media/i2c/rdacm20.c
> @@ -611,7 +611,7 @@ static int rdacm20_probe(struct i2c_client *client)
>                 goto error_free_ctrls;
>  
>         dev->pad.flags = MEDIA_PAD_FL_SOURCE;
> -       dev->sd.entity.flags |= MEDIA_ENT_F_CAM_SENSOR;
> +       dev->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
>         ret = media_entity_pads_init(&dev->sd.entity, 1, &dev->pad);
>         if (ret < 0)
>                 goto error_free_ctrls;
> diff --git a/drivers/media/i2c/rdacm21.c b/drivers/media/i2c/rdacm21.c
> index 12ec5467ed1e..ef31cf5f23ca 100644
> --- a/drivers/media/i2c/rdacm21.c
> +++ b/drivers/media/i2c/rdacm21.c
> @@ -583,7 +583,7 @@ static int rdacm21_probe(struct i2c_client *client)
>                 goto error_free_ctrls;
>  
>         dev->pad.flags = MEDIA_PAD_FL_SOURCE;
> -       dev->sd.entity.flags |= MEDIA_ENT_F_CAM_SENSOR;
> +       dev->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
>         ret = media_entity_pads_init(&dev->sd.entity, 1, &dev->pad);
>         if (ret < 0)
>                 goto error_free_ctrls;
> -- 
> 2.17.1
>
diff mbox series

Patch

diff --git a/drivers/media/i2c/rdacm20.c b/drivers/media/i2c/rdacm20.c
index 025a610de893..9c6f66cab564 100644
--- a/drivers/media/i2c/rdacm20.c
+++ b/drivers/media/i2c/rdacm20.c
@@ -611,7 +611,7 @@  static int rdacm20_probe(struct i2c_client *client)
 		goto error_free_ctrls;
 
 	dev->pad.flags = MEDIA_PAD_FL_SOURCE;
-	dev->sd.entity.flags |= MEDIA_ENT_F_CAM_SENSOR;
+	dev->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
 	ret = media_entity_pads_init(&dev->sd.entity, 1, &dev->pad);
 	if (ret < 0)
 		goto error_free_ctrls;
diff --git a/drivers/media/i2c/rdacm21.c b/drivers/media/i2c/rdacm21.c
index 12ec5467ed1e..ef31cf5f23ca 100644
--- a/drivers/media/i2c/rdacm21.c
+++ b/drivers/media/i2c/rdacm21.c
@@ -583,7 +583,7 @@  static int rdacm21_probe(struct i2c_client *client)
 		goto error_free_ctrls;
 
 	dev->pad.flags = MEDIA_PAD_FL_SOURCE;
-	dev->sd.entity.flags |= MEDIA_ENT_F_CAM_SENSOR;
+	dev->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
 	ret = media_entity_pads_init(&dev->sd.entity, 1, &dev->pad);
 	if (ret < 0)
 		goto error_free_ctrls;