* [PATCH AUTOSEL 5.10 043/114] media: c8sectpfe: Call of_node_put(i2c_bus) only once in c8sectpfe_probe()
[not found] <20250505231817.2697367-1-sashal@kernel.org>
@ 2025-05-05 23:17 ` Sasha Levin
2025-05-05 23:17 ` [PATCH AUTOSEL 5.10 047/114] media: cx231xx: set device_caps for 417 Sasha Levin
2025-05-05 23:17 ` [PATCH AUTOSEL 5.10 089/114] media: v4l: Memset argument to 0 before calling get_mbus_config pad op Sasha Levin
2 siblings, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2025-05-05 23:17 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Markus Elfring, Hans Verkuil, Sasha Levin, mchehab, linux-media
From: Markus Elfring <elfring@users.sourceforge.net>
[ Upstream commit b773530a34df0687020520015057075f8b7b4ac4 ]
An of_node_put(i2c_bus) call was immediately used after a pointer check
for an of_find_i2c_adapter_by_node() call in this function implementation.
Thus call such a function only once instead directly before the check.
This issue was transformed by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
index b7e0ec265b70c..6e3b3643a2cdb 100644
--- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
+++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
@@ -811,13 +811,12 @@ static int c8sectpfe_probe(struct platform_device *pdev)
}
tsin->i2c_adapter =
of_find_i2c_adapter_by_node(i2c_bus);
+ of_node_put(i2c_bus);
if (!tsin->i2c_adapter) {
dev_err(&pdev->dev, "No i2c adapter found\n");
- of_node_put(i2c_bus);
ret = -ENODEV;
goto err_clk_disable;
}
- of_node_put(i2c_bus);
tsin->rst_gpio = of_get_named_gpio(child, "reset-gpios", 0);
--
2.39.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH AUTOSEL 5.10 047/114] media: cx231xx: set device_caps for 417
[not found] <20250505231817.2697367-1-sashal@kernel.org>
2025-05-05 23:17 ` [PATCH AUTOSEL 5.10 043/114] media: c8sectpfe: Call of_node_put(i2c_bus) only once in c8sectpfe_probe() Sasha Levin
@ 2025-05-05 23:17 ` Sasha Levin
2025-05-05 23:17 ` [PATCH AUTOSEL 5.10 089/114] media: v4l: Memset argument to 0 before calling get_mbus_config pad op Sasha Levin
2 siblings, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2025-05-05 23:17 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Hans Verkuil, Mauro Carvalho Chehab, Sasha Levin, mchehab,
christophe.jaillet, ribalda, linux-media
From: Hans Verkuil <hverkuil@xs4all.nl>
[ Upstream commit a79efc44b51432490538a55b9753a721f7d3ea42 ]
The video_device for the MPEG encoder did not set device_caps.
Add this, otherwise the video device can't be registered (you get a
WARN_ON instead).
Not seen before since currently 417 support is disabled, but I found
this while experimenting with it.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/usb/cx231xx/cx231xx-417.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/media/usb/cx231xx/cx231xx-417.c b/drivers/media/usb/cx231xx/cx231xx-417.c
index c5e21785fafe2..02343e88cc618 100644
--- a/drivers/media/usb/cx231xx/cx231xx-417.c
+++ b/drivers/media/usb/cx231xx/cx231xx-417.c
@@ -1722,6 +1722,8 @@ static void cx231xx_video_dev_init(
vfd->lock = &dev->lock;
vfd->release = video_device_release_empty;
vfd->ctrl_handler = &dev->mpeg_ctrl_handler.hdl;
+ vfd->device_caps = V4L2_CAP_READWRITE | V4L2_CAP_STREAMING |
+ V4L2_CAP_VIDEO_CAPTURE;
video_set_drvdata(vfd, dev);
if (dev->tuner_type == TUNER_ABSENT) {
v4l2_disable_ioctl(vfd, VIDIOC_G_FREQUENCY);
--
2.39.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH AUTOSEL 5.10 089/114] media: v4l: Memset argument to 0 before calling get_mbus_config pad op
[not found] <20250505231817.2697367-1-sashal@kernel.org>
2025-05-05 23:17 ` [PATCH AUTOSEL 5.10 043/114] media: c8sectpfe: Call of_node_put(i2c_bus) only once in c8sectpfe_probe() Sasha Levin
2025-05-05 23:17 ` [PATCH AUTOSEL 5.10 047/114] media: cx231xx: set device_caps for 417 Sasha Levin
@ 2025-05-05 23:17 ` Sasha Levin
2 siblings, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2025-05-05 23:17 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Sakari Ailus, Tomi Valkeinen, Hans Verkuil, Sasha Levin, mchehab,
laurent.pinchart+renesas, umang.jain, prabhakar.mahadev-lad.rj,
tomm.merciai, linux-media
From: Sakari Ailus <sakari.ailus@linux.intel.com>
[ Upstream commit 91d6a99acfa5ce9f95ede775074b80f7193bd717 ]
Memset the config argument to get_mbus_config V4L2 sub-device pad
operation to zero before calling the operation. This ensures the callers
don't need to bother with it nor the implementations need to set all
fields that may not be relevant to them.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/v4l2-core/v4l2-subdev.c | 2 ++
include/media/v4l2-subdev.h | 4 +++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index fbf0dcb313c82..67d3e6511a146 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -312,6 +312,8 @@ static int call_enum_dv_timings(struct v4l2_subdev *sd,
static int call_get_mbus_config(struct v4l2_subdev *sd, unsigned int pad,
struct v4l2_mbus_config *config)
{
+ memset(config, 0, sizeof(*config));
+
return check_pad(sd, pad) ? :
sd->ops->pad->get_mbus_config(sd, pad, config);
}
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 73150520c02d4..ffc6d122f91e5 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -676,7 +676,9 @@ struct v4l2_subdev_pad_config {
* possible configuration from the remote end, likely calling
* this operation as close as possible to stream on time. The
* operation shall fail if the pad index it has been called on
- * is not valid or in case of unrecoverable failures.
+ * is not valid or in case of unrecoverable failures. The
+ * config argument has been memset to 0 just before calling
+ * the op.
*
* @set_mbus_config: set the media bus configuration of a remote sub-device.
* This operations is intended to allow, in combination with
--
2.39.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-05 23:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20250505231817.2697367-1-sashal@kernel.org>
2025-05-05 23:17 ` [PATCH AUTOSEL 5.10 043/114] media: c8sectpfe: Call of_node_put(i2c_bus) only once in c8sectpfe_probe() Sasha Levin
2025-05-05 23:17 ` [PATCH AUTOSEL 5.10 047/114] media: cx231xx: set device_caps for 417 Sasha Levin
2025-05-05 23:17 ` [PATCH AUTOSEL 5.10 089/114] media: v4l: Memset argument to 0 before calling get_mbus_config pad op Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox