media: mali-c55: Fix NULL dev stream alert for tpg/rsz/isp sub-device
Subsystems (2)
PATCH v2 1/1 media: mali-c55: Fix NULL dev stream alert for tpg/rsz/isp sub-device
The subdevices registered by the Mali-C55 driver do not have their 'struct device *dev' member initialized. This is visibile when looking at debug message, as in example:
"(NULL device *): collect_streams: sub-device 'mali-c55 tpg' does not
support streams"
Fix this by initializing the *dev field for each subdevice registered by the Mali-C55 driver.
--- drivers/media/platform/arm/mali-c55/mali-c55-isp.c | 1 + drivers/media/platform/arm/mali-c55/mali-c55-resizer.c | 1 + drivers/media/platform/arm/mali-c55/mali-c55-tpg.c | 1 + 3 files changed, 3 insertions(+)
drivers/media/platform/arm/mali-c55/mali-c55-isp.c +1 -0
@@ -610,6 +610,7 @@ int mali_c55_register_isp(struct mali_c55 *mali_c55) sd->entity.ops = &mali_c55_isp_media_ops; sd->entity.function =MEDIA_ENT_F_PROC_VIDEO_ISP ; sd->internal_ops = &mali_c55_isp_internal_ops; + sd->dev = mali_c55->dev;strscpy (sd->name,MALI_C55_DRIVER_NAME " isp" ,sizeof (sd->name)); isp->pads[MALI_C55_ISP_PAD_SINK_VIDEO].flags = MEDIA_PAD_FL_SINK |
drivers/media/platform/arm/mali-c55/mali-c55-resizer.c +1 -0
@@ -1070,6 +1070,7 @@ static int mali_c55_register_resizer(struct mali_c55 *mali_c55, sd->flags |=V4L2_SUBDEV_FL_HAS_DEVNODE |V4L2_SUBDEV_FL_STREAMS ; sd->entity.function =MEDIA_ENT_F_PROC_VIDEO_SCALER ; sd->internal_ops = &mali_c55_resizer_internal_ops; + sd->dev = mali_c55->dev; rsz->pads[MALI_C55_RSZ_SINK_PAD ].flags =MEDIA_PAD_FL_SINK ; rsz->pads[MALI_C55_RSZ_SOURCE_PAD ].flags =MEDIA_PAD_FL_SOURCE ;
drivers/media/platform/arm/mali-c55/mali-c55-tpg.c +1 -0
@@ -370,6 +370,7 @@ int mali_c55_register_tpg(struct mali_c55 *mali_c55) sd->flags |=V4L2_SUBDEV_FL_HAS_DEVNODE |V4L2_SUBDEV_FL_HAS_EVENTS ; sd->entity.function =MEDIA_ENT_F_CAM_SENSOR ; sd->internal_ops = &mali_c55_tpg_internal_ops; + sd->dev = mali_c55->dev;strscpy (sd->name,MALI_C55_DRIVER_NAME " tpg" ,sizeof (sd->name)); pad->flags =MEDIA_PAD_FL_SOURCE ;
Signature · 1 line
2.25.1
Hi Jempty, thanks for the patch
Quoted 2 lines · jempty.liang
The subdevices registered by the Mali-C55 driver do not have their 'struct device *dev' member initialized. This is visibile when looking
s/visibile/visible
The commit header also needs correcting really, as it still suggests that fixing the printout is the goal. Perhaps something like "media: mali-c55: Initialise dev member for struct v4l2_subdev"?
With that:
Quoted 52 lines
at debug message, as in example:
"(NULL device *):
collect_streams: sub-device 'mali-c55 tpg' does not
support streams"Fix this by initializing the *dev field for each subdevice registered by the Mali-C55 driver.
Suggested-by Jacopo Mondi <[email protected]>Signed-off-by jempty.liang <[email protected]>--- drivers/media/platform/arm/mali-c55/mali-c55-isp.c | 1 + drivers/media/platform/arm/mali-c55/mali-c55-resizer.c | 1 + drivers/media/platform/arm/mali-c55/mali-c55-tpg.c | 1 + 3 files changed, 3 insertions(+)drivers/media/platform/arm/mali-c55/mali-c55-isp.c +1
-0@@ -610,6 +610,7 @@ int mali_c55_register_isp(struct mali_c55 *mali_c55) sd->entity.ops = &mali_c55_isp_media_ops; sd->entity.function =MEDIA_ENT_F_PROC_VIDEO_ISP ; sd->internal_ops = &mali_c55_isp_internal_ops; + sd->dev = mali_c55->dev;strscpy (sd->name,MALI_C55_DRIVER_NAME " isp" ,sizeof (sd->name)); isp->pads[MALI_C55_ISP_PAD_SINK_VIDEO].flags = MEDIA_PAD_FL_SINK |drivers/media/platform/arm/mali-c55/mali-c55-resizer.c +1
-0@@ -1070,6 +1070,7 @@ static int mali_c55_register_resizer(struct mali_c55 *mali_c55, sd->flags |=V4L2_SUBDEV_FL_HAS_DEVNODE |V4L2_SUBDEV_FL_STREAMS ; sd->entity.function =MEDIA_ENT_F_PROC_VIDEO_SCALER ; sd->internal_ops = &mali_c55_resizer_internal_ops; + sd->dev = mali_c55->dev; rsz->pads[MALI_C55_RSZ_SINK_PAD ].flags =MEDIA_PAD_FL_SINK ; rsz->pads[MALI_C55_RSZ_SOURCE_PAD ].flags =MEDIA_PAD_FL_SOURCE ;drivers/media/platform/arm/mali-c55/mali-c55-tpg.c +1
-0@@ -370,6 +370,7 @@ int mali_c55_register_tpg(struct mali_c55 *mali_c55) sd->flags |=V4L2_SUBDEV_FL_HAS_DEVNODE |V4L2_SUBDEV_FL_HAS_EVENTS ; sd->entity.function =MEDIA_ENT_F_CAM_SENSOR ; sd->internal_ops = &mali_c55_tpg_internal_ops; + sd->dev = mali_c55->dev;strscpy (sd->name,MALI_C55_DRIVER_NAME " tpg" ,sizeof (sd->name)); pad->flags =MEDIA_PAD_FL_SOURCE ;
Hi Dan, Jempty
Quoted 11 lines · Dan Scally
Hi Jempty, thanks for the patch
Quoted 2 lines · jempty.liang
The subdevices registered by the Mali-C55 driver do not have their 'struct device *dev' member initialized. This is visibile when looking
s/visibile/visible
The commit header also needs correcting really, as it still suggests that fixing the printout is the goal. Perhaps something like "media: mali-c55:
Initialise dev member for structv4l2_subdev"?
Right, sorry, I missed the commit message during review
Quoted 14 lines
With that:
Reviewed-by Daniel Scally <[email protected]>Quoted 9 lines
at debug message, as in example:
"(NULL device *):
collect_streams: sub-device 'mali-c55 tpg' does not
support streams"Fix this by initializing the *dev field for each subdevice registered by the Mali-C55 driver.
Suggested-by Jacopo Mondi <[email protected]>
Oh, no need to, I simply reviewed the patch :)
Quoted 1 line
Quoted 1 line
Signed-off-by jempty.liang <[email protected]>
With Dan's suggestion:
Thanks
j
Quoted 40 lines
Quoted 39 lines
--- drivers/media/platform/arm/mali-c55/mali-c55-isp.c | 1 + drivers/media/platform/arm/mali-c55/mali-c55-resizer.c | 1 + drivers/media/platform/arm/mali-c55/mali-c55-tpg.c | 1 + 3 files changed, 3 insertions(+)drivers/media/platform/arm/mali-c55/mali-c55-isp.c +1
-0@@ -610,6 +610,7 @@ int mali_c55_register_isp(struct mali_c55 *mali_c55) sd->entity.ops = &mali_c55_isp_media_ops; sd->entity.function =MEDIA_ENT_F_PROC_VIDEO_ISP ; sd->internal_ops = &mali_c55_isp_internal_ops; + sd->dev = mali_c55->dev;strscpy (sd->name,MALI_C55_DRIVER_NAME " isp" ,sizeof (sd->name)); isp->pads[MALI_C55_ISP_PAD_SINK_VIDEO].flags = MEDIA_PAD_FL_SINK |drivers/media/platform/arm/mali-c55/mali-c55-resizer.c +1
-0@@ -1070,6 +1070,7 @@ static int mali_c55_register_resizer(struct mali_c55 *mali_c55, sd->flags |=V4L2_SUBDEV_FL_HAS_DEVNODE |V4L2_SUBDEV_FL_STREAMS ; sd->entity.function =MEDIA_ENT_F_PROC_VIDEO_SCALER ; sd->internal_ops = &mali_c55_resizer_internal_ops; + sd->dev = mali_c55->dev; rsz->pads[MALI_C55_RSZ_SINK_PAD ].flags =MEDIA_PAD_FL_SINK ; rsz->pads[MALI_C55_RSZ_SOURCE_PAD ].flags =MEDIA_PAD_FL_SOURCE ;drivers/media/platform/arm/mali-c55/mali-c55-tpg.c +1
-0@@ -370,6 +370,7 @@ int mali_c55_register_tpg(struct mali_c55 *mali_c55) sd->flags |=V4L2_SUBDEV_FL_HAS_DEVNODE |V4L2_SUBDEV_FL_HAS_EVENTS ; sd->entity.function =MEDIA_ENT_F_CAM_SENSOR ; sd->internal_ops = &mali_c55_tpg_internal_ops; + sd->dev = mali_c55->dev;strscpy (sd->name,MALI_C55_DRIVER_NAME " tpg" ,sizeof (sd->name)); pad->flags =MEDIA_PAD_FL_SOURCE ;