aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/smiapp/smiapp-core.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-09-21 19:33:54 (GMT)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-09-21 19:33:54 (GMT)
commit0648f853fc8893d3ce5758090c579d7ccbf201a5 (patch)
tree3c05ab475b8b99842b79987b909fdd76728914d4 /drivers/media/i2c/smiapp/smiapp-core.c
parent91fe4d981ba52985ec6b2ff43f14b9afb7eec43d (diff)
parenta04646c045cab08a9e62b9be8f01ecbb0632d24e (diff)
Merge tag 'media-v3.17-rc6' into topic/develold/cs_0648f853fc88
media fixes for v3.17-rc6 * tag 'media-v3.17-rc6': [media] af9035: new IDs: add support for PCTV 78e and PCTV 79e [media] af9033: feed clock to RF tuner [media] it913x: init tuner on attach [media] af9033: update IT9135 tuner inittabs [media] Kconfig: do not select SPI bus on sub-driver auto-select [media] cx18: fix kernel oops with tda8290 tuner [media] smiapp: Set sub-device owner [media] smiapp: Fix power count handling
Diffstat (limited to 'drivers/media/i2c/smiapp/smiapp-core.c')
-rw-r--r--drivers/media/i2c/smiapp/smiapp-core.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
index d312932..932ed9b 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -1322,19 +1322,12 @@ static int smiapp_set_power(struct v4l2_subdev *subdev, int on)
mutex_lock(&sensor->power_mutex);
- /*
- * If the power count is modified from 0 to != 0 or from != 0
- * to 0, update the power state.
- */
- if (!sensor->power_count == !on)
- goto out;
-
- if (on) {
+ if (on && !sensor->power_count) {
/* Power on and perform initialisation. */
ret = smiapp_power_on(sensor);
if (ret < 0)
goto out;
- } else {
+ } else if (!on && sensor->power_count == 1) {
smiapp_power_off(sensor);
}
@@ -2629,7 +2622,7 @@ static int smiapp_registered(struct v4l2_subdev *subdev)
this->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
this->sd.internal_ops = &smiapp_internal_ops;
- this->sd.owner = NULL;
+ this->sd.owner = THIS_MODULE;
v4l2_set_subdevdata(&this->sd, client);
rval = media_entity_init(&this->sd.entity,

Privacy Policy