summaryrefslogtreecommitdiff
path: root/drivers/media/i2c/smiapp/smiapp-core.c
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2016-09-07 06:40:13 -0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-10-21 15:00:06 -0200
commit231d1a014aeb8c2288316572f2fe876c5145b91c (patch)
tree0091a905dbb2b4048ac37935d752674051dcf7f5 /drivers/media/i2c/smiapp/smiapp-core.c
parent624e9896c5bffee146ebb05b9366f8dc3f8b54aa (diff)
[media] smiapp: Always initialise the sensor in probe
Initialise the sensor in probe. The reason why it wasn't previously done in case of platform data was that the probe() of the driver that provided the clock through the set_xclk() callback would need to finish before the probe() function of the smiapp driver. The set_xclk() callback no longer exists. 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>
Diffstat (limited to 'drivers/media/i2c/smiapp/smiapp-core.c')
-rw-r--r--drivers/media/i2c/smiapp/smiapp-core.c30
1 files changed, 5 insertions, 25 deletions
diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
index 9873b3d764db..8a58c641bc47 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -2530,8 +2530,9 @@ static int smiapp_register_subdev(struct smiapp_sensor *sensor,
return 0;
}
-static int smiapp_register_subdevs(struct smiapp_sensor *sensor)
+static int smiapp_registered(struct v4l2_subdev *subdev)
{
+ struct smiapp_sensor *sensor = to_smiapp_sensor(subdev);
int rval;
if (sensor->scaler) {
@@ -2819,25 +2820,6 @@ out_power_off:
return rval;
}
-static int smiapp_registered(struct v4l2_subdev *subdev)
-{
- struct smiapp_sensor *sensor = to_smiapp_sensor(subdev);
- struct i2c_client *client = v4l2_get_subdevdata(subdev);
- int rval;
-
- if (!client->dev.of_node) {
- rval = smiapp_init(sensor);
- if (rval)
- return rval;
- }
-
- rval = smiapp_register_subdevs(sensor);
- if (rval)
- smiapp_cleanup(sensor);
-
- return rval;
-}
-
static int smiapp_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{
struct smiapp_subdev *ssd = to_smiapp_subdev(sd);
@@ -3079,11 +3061,9 @@ static int smiapp_probe(struct i2c_client *client,
sensor->src->sensor = sensor;
sensor->src->pads[0].flags = MEDIA_PAD_FL_SOURCE;
- if (client->dev.of_node) {
- rval = smiapp_init(sensor);
- if (rval)
- goto out_media_entity_cleanup;
- }
+ rval = smiapp_init(sensor);
+ if (rval)
+ goto out_media_entity_cleanup;
rval = media_entity_pads_init(&sensor->src->sd.entity, 2,
sensor->src->pads);