Skip to content

Commit

Permalink
media: tc358743: register v4l2 async device only after successful setup
Browse files Browse the repository at this point in the history
Ensure the device has been setup correctly before registering the v4l2
async device, thus allowing userspace to access.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Robert Foss <rfoss@kernel.org>
Fixes: 4c5211a ("[media] tc358743: register v4l2 asynchronous subdevice")
Signed-off-by: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240110090111.458115-1-alexander.stein@ew.tq-group.com
  • Loading branch information
Alexander Stein authored and Robert Foss committed Jan 22, 2024
1 parent 72a0cfd commit 87399f1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/media/i2c/tc358743.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 87399f1

Please sign in to comment.