Skip to content

Commit

Permalink
Revert "iio: accel: st_accel: remove redundant pointer pdata"
Browse files Browse the repository at this point in the history
This reverts commit 585ed27.

This removed code which was unused due to a bug in commit 7383d44.
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>
  • Loading branch information
Jonathan Cameron authored and Jonathan Cameron committed Mar 10, 2018
1 parent 3c3e4b3 commit cc4e003
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/iio/accel/st_accel_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down

0 comments on commit cc4e003

Please sign in to comment.