* [PATCH v2] media: cx25840: guard entity cleanup
@ 2026-11-30 4:10 pg.radadia
0 siblings, 0 replies; only message in thread
From: pg.radadia @ 2026-11-30 4:10 UTC (permalink / raw)
To: linux-media; +Cc: mchehab, Pragnesh Radadiya
From: Pragnesh Radadiya <pg.radadia@gmail.com>
The media entity is initialized only when CONFIG_MEDIA_CONTROLLER is
enabled, but the probe error path and remove path always clean it up.
Guard both calls so the driver also builds without media-controller
support.
Tested:
- Build cx25840-core.o with CONFIG_MEDIA_CONTROLLER enabled and
disabled on v7.3.3 and upstream HEAD.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=222245
Signed-off-by: Pragnesh Radadiya <pg.radadia@gmail.com>
---
Changes in v2:
- Add a Link tag to the Bugzilla report.
drivers/media/i2c/cx25840/cx25840-core.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/media/i2c/cx25840/cx25840-core.c b/drivers/media/i2c/cx25840/cx25840-core.c
index 7066b2252..91794ec59 100644
--- a/drivers/media/i2c/cx25840/cx25840-core.c
+++ b/drivers/media/i2c/cx25840/cx25840-core.c
@@ -3961,7 +3961,9 @@ static int cx25840_probe(struct i2c_client *client)
int err = state->hdl.error;
v4l2_ctrl_handler_free(&state->hdl);
+#if defined(CONFIG_MEDIA_CONTROLLER)
media_entity_cleanup(&sd->entity);
+#endif
return err;
}
if (!is_cx2583x(state))
@@ -3986,7 +3988,9 @@ static void cx25840_remove(struct i2c_client *client)
cx25840_ir_remove(sd);
v4l2_device_unregister_subdev(sd);
v4l2_ctrl_handler_free(&state->hdl);
+#if defined(CONFIG_MEDIA_CONTROLLER)
media_entity_cleanup(&sd->entity);
+#endif
}
static const struct i2c_device_id cx25840_id[] = {
--
2.43.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-30 4:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 4:10 [PATCH v2] media: cx25840: guard entity cleanup pg.radadia
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.