mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-12 08:09:56 +00:00
[media] smiapp: Unify setting up sub-devices
The initialisation of the source sub-device is somewhat different as it's not created by the smiapp driver itself. Remove redundancy in initialising the two kind of sub-devices. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
parent
1344bf74c9
commit
a118e61edc
@ -2591,6 +2591,7 @@ static void smiapp_create_subdev(struct smiapp_sensor *sensor,
|
||||
if (ssd != sensor->src)
|
||||
v4l2_subdev_init(&ssd->sd, &smiapp_ops);
|
||||
|
||||
ssd->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
|
||||
ssd->sensor = sensor;
|
||||
|
||||
ssd->npads = num_pads;
|
||||
@ -2616,7 +2617,6 @@ static void smiapp_create_subdev(struct smiapp_sensor *sensor,
|
||||
if (ssd == sensor->src)
|
||||
return;
|
||||
|
||||
ssd->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
|
||||
ssd->sd.internal_ops = &smiapp_internal_ops;
|
||||
ssd->sd.owner = THIS_MODULE;
|
||||
v4l2_set_subdevdata(&ssd->sd, client);
|
||||
@ -2861,9 +2861,6 @@ static int smiapp_probe(struct i2c_client *client,
|
||||
|
||||
v4l2_i2c_subdev_init(&sensor->src->sd, client, &smiapp_ops);
|
||||
sensor->src->sd.internal_ops = &smiapp_internal_src_ops;
|
||||
sensor->src->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
|
||||
sensor->src->sensor = sensor;
|
||||
sensor->src->pads[0].flags = MEDIA_PAD_FL_SOURCE;
|
||||
|
||||
sensor->vana = devm_regulator_get(&client->dev, "vana");
|
||||
if (IS_ERR(sensor->vana)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user