Re: [PATCH v2 10/17] smiapp: Unify setting up sub-devices

2016-09-19 Thread Sebastian Reichel
Hi,

On Thu, Sep 15, 2016 at 02:22:24PM +0300, Sakari Ailus wrote:
> 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.

Reviewed-By: Sebastian Reichel 

-- Sebastian


signature.asc
Description: PGP signature


[PATCH v2 10/17] smiapp: Unify setting up sub-devices

2016-09-15 Thread Sakari Ailus
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 
---
 drivers/media/i2c/smiapp/smiapp-core.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c 
b/drivers/media/i2c/smiapp/smiapp-core.c
index c9aee83..b446d0a 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -2574,6 +2574,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;
@@ -2599,7 +2600,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);
@@ -2843,9 +2843,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)) {
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html