diff options
author | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2018-03-10 17:21:32 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2018-03-10 17:21:32 +0100 |
commit | cc4e0036311fbb0b2cab7dc8f142f84ebd8b388b (patch) | |
tree | 23c3bccc64dace90385a645fb306afa7d82226a4 /drivers/iio | |
parent | iio: adc: meson-saradc: unlock on error in meson_sar_adc_lock() (diff) | |
download | linux-cc4e0036311fbb0b2cab7dc8f142f84ebd8b388b.tar.xz linux-cc4e0036311fbb0b2cab7dc8f142f84ebd8b388b.zip |
Revert "iio: accel: st_accel: remove redundant pointer pdata"
This reverts commit 585ed27d06151f98e39238298f43ee261314ae74.
This removed code which was unused due to a bug in commit 7383d44b.
To fix this bug the code is needed. Thus this revert.
Signed-off-by: Michael Nosthoff <committed@heine.so>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/accel/st_accel_core.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c index 6fe995cf16a6..460aa58e0159 100644 --- a/drivers/iio/accel/st_accel_core.c +++ b/drivers/iio/accel/st_accel_core.c @@ -920,6 +920,8 @@ static const struct iio_trigger_ops st_accel_trigger_ops = { int st_accel_common_probe(struct iio_dev *indio_dev) { struct st_sensor_data *adata = iio_priv(indio_dev); + struct st_sensors_platform_data *pdata = + (struct st_sensors_platform_data *)adata->dev->platform_data; int irq = adata->get_irq_data_ready(indio_dev); int err; @@ -946,6 +948,9 @@ int st_accel_common_probe(struct iio_dev *indio_dev) &adata->sensor_settings->fs.fs_avl[0]; adata->odr = adata->sensor_settings->odr.odr_avl[0].hz; + if (!pdata) + pdata = (struct st_sensors_platform_data *)&default_accel_pdata; + err = st_sensors_init_sensor(indio_dev, adata->dev->platform_data); if (err < 0) goto st_accel_power_off; |