提交 cc4e0036 编写于 作者: J Jonathan Cameron

Revert "iio: accel: st_accel: remove redundant pointer pdata"

This reverts commit 585ed27d.

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: NMichael Nosthoff <committed@heine.so>
Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
上级 3c3e4b3a
...@@ -920,6 +920,8 @@ static const struct iio_trigger_ops st_accel_trigger_ops = { ...@@ -920,6 +920,8 @@ static const struct iio_trigger_ops st_accel_trigger_ops = {
int st_accel_common_probe(struct iio_dev *indio_dev) int st_accel_common_probe(struct iio_dev *indio_dev)
{ {
struct st_sensor_data *adata = iio_priv(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 irq = adata->get_irq_data_ready(indio_dev);
int err; int err;
...@@ -946,6 +948,9 @@ int st_accel_common_probe(struct iio_dev *indio_dev) ...@@ -946,6 +948,9 @@ int st_accel_common_probe(struct iio_dev *indio_dev)
&adata->sensor_settings->fs.fs_avl[0]; &adata->sensor_settings->fs.fs_avl[0];
adata->odr = adata->sensor_settings->odr.odr_avl[0].hz; 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); err = st_sensors_init_sensor(indio_dev, adata->dev->platform_data);
if (err < 0) if (err < 0)
goto st_accel_power_off; goto st_accel_power_off;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册