Skip to content

Commit 94b76ce

Browse files
pH5mchehab
authored andcommitted
[media] mt9v032: register v4l2 asynchronous subdevice
Add support for registering the sensor subdevice using the v4l2-async API. Signed-off-by: Philipp Zabel <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent d8dde6c commit 94b76ce

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

drivers/media/i2c/mt9v032.c

+11-1
Original file line numberDiff line numberDiff line change
@@ -1010,10 +1010,19 @@ static int mt9v032_probe(struct i2c_client *client,
10101010

10111011
mt9v032->pad.flags = MEDIA_PAD_FL_SOURCE;
10121012
ret = media_entity_init(&mt9v032->subdev.entity, 1, &mt9v032->pad, 0);
1013+
if (ret < 0)
1014+
goto err;
10131015

1016+
mt9v032->subdev.dev = &client->dev;
1017+
ret = v4l2_async_register_subdev(&mt9v032->subdev);
10141018
if (ret < 0)
1015-
v4l2_ctrl_handler_free(&mt9v032->ctrls);
1019+
goto err;
1020+
1021+
return 0;
10161022

1023+
err:
1024+
media_entity_cleanup(&mt9v032->subdev.entity);
1025+
v4l2_ctrl_handler_free(&mt9v032->ctrls);
10171026
return ret;
10181027
}
10191028

@@ -1022,6 +1031,7 @@ static int mt9v032_remove(struct i2c_client *client)
10221031
struct v4l2_subdev *subdev = i2c_get_clientdata(client);
10231032
struct mt9v032 *mt9v032 = to_mt9v032(subdev);
10241033

1034+
v4l2_async_unregister_subdev(subdev);
10251035
v4l2_ctrl_handler_free(&mt9v032->ctrls);
10261036
v4l2_device_unregister_subdev(subdev);
10271037
media_entity_cleanup(&subdev->entity);

0 commit comments

Comments
 (0)