Skip to contentSkip to conversation

media: tc358743: register v4l2 async device only after successful setup

git:media_stage/master Mauro Carvalho Chehab 1 participant 1 message Feb 1, 2024

Subsystems (3)
lore
Share & tools
lore

Mauro Carvalho Chehab

author maintainer
#0 lore raw

This is an automatic generated email to let you know that the following patch were queued:

Subject: media: tc358743: register v4l2 async device only after successful setup
Author:  Alexander Stein <[email protected]>
Date:    Wed Jan 10 10:01:11 2024 +0100

Ensure the device has been setup correctly before registering the v4l2 async device, thus allowing userspace to access.

Fixes 4c5211a10039 ("[media] tc358743: register v4l2 asynchronous subdevice")
 drivers/media/i2c/tc358743.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

---

drivers/media/i2c/tc358743.c +4 -3
index 2785935da497..558152575d10 100644
@@ -2091,9 +2091,6 @@ static int tc358743_probe(struct i2c_client *client)
 	state->mbus_fmt_code = MEDIA_BUS_FMT_RGB888_1X24;
 
 	sd->dev = &client->dev;
-	err = v4l2_async_register_subdev(sd);
-	if (err < 0)
-		goto err_hdl;
 
 	mutex_init(&state->confctl_mutex);
 
@@ -2151,6 +2148,10 @@ static int tc358743_probe(struct i2c_client *client)
 	if (err)
 		goto err_work_queues;
 
+	err = v4l2_async_register_subdev(sd);
+	if (err < 0)
+		goto err_work_queues;
+
 	v4l2_info(sd, "%s found @ 0x%x (%s)\n", client->name,
 		  client->addr << 1, client->adapter->name);