summaryrefslogtreecommitdiffstats
path: root/drivers/iio/accel/bma180.c
diff options
context:
space:
mode:
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2014-08-22 22:48:00 +0200
committerJonathan Cameron <jic23@kernel.org>2014-08-25 22:48:04 +0200
commit0668a4e4d297328ce08b44d91d160537596115e2 (patch)
tree31c1927cd876c6263bf802844e9438fa9c56c58e /drivers/iio/accel/bma180.c
parentiio:trigger: modify return value for iio_trigger_get (diff)
downloadlinux-0668a4e4d297328ce08b44d91d160537596115e2.tar.xz
linux-0668a4e4d297328ce08b44d91d160537596115e2.zip
iio: accel: bma180: Fix indio_dev->trig assignment
This can result in wrong reference count for trigger device, call iio_trigger_get to increment reference. Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion with Jonathan. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Cc: Stable@vger.kernel.org
Diffstat (limited to 'drivers/iio/accel/bma180.c')
-rw-r--r--drivers/iio/accel/bma180.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c
index a077cc86421b..19100fddd2ed 100644
--- a/drivers/iio/accel/bma180.c
+++ b/drivers/iio/accel/bma180.c
@@ -571,7 +571,7 @@ static int bma180_probe(struct i2c_client *client,
trig->ops = &bma180_trigger_ops;
iio_trigger_set_drvdata(trig, indio_dev);
data->trig = trig;
- indio_dev->trig = trig;
+ indio_dev->trig = iio_trigger_get(trig);
ret = iio_trigger_register(trig);
if (ret)