diff options
author | Michael Nosthoff <committed@heine.so> | 2018-03-09 10:02:45 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2018-03-10 17:28:05 +0100 |
commit | 8b438686a001db64c21782d04ef68111e53c45d9 (patch) | |
tree | 080875d3c13c22bb4da256379e06717ff833635d /drivers/iio/pressure | |
parent | Revert "iio: accel: st_accel: remove redundant pointer pdata" (diff) | |
download | linux-8b438686a001db64c21782d04ef68111e53c45d9.tar.xz linux-8b438686a001db64c21782d04ef68111e53c45d9.zip |
iio: st_pressure: st_accel: pass correct platform data to init
Commit 7383d44b added a pointer pdata which get set to the default
platform_data when non was defined in the device. But it did not
pass this pointer to the st_sensors_init_sensor call but still
used the maybe uninitialized platform_data from dev.
This breaks initialization when no platform_data is given and
the optional st,drdy-int-pin devicetree option is not set.
This commit fixes this.
Cc: stable@vger.kernel.org
Fixes: 7383d44b ("iio: st_pressure: st_accel: Initialise sensor platform data properly")
Signed-off-by: Michael Nosthoff <committed@heine.so>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/pressure')
-rw-r--r-- | drivers/iio/pressure/st_pressure_core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c index 349e5c713c03..4ddb6cf7d401 100644 --- a/drivers/iio/pressure/st_pressure_core.c +++ b/drivers/iio/pressure/st_pressure_core.c @@ -640,7 +640,7 @@ int st_press_common_probe(struct iio_dev *indio_dev) press_data->sensor_settings->drdy_irq.int2.addr)) pdata = (struct st_sensors_platform_data *)&default_press_pdata; - err = st_sensors_init_sensor(indio_dev, press_data->dev->platform_data); + err = st_sensors_init_sensor(indio_dev, pdata); if (err < 0) goto st_press_power_off; |