All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] iio: accel: Revert "iio: accel: st_accel: remove redundant pointer pdata"
@ 2018-03-09  9:01 Michael Nosthoff
  0 siblings, 0 replies; only message in thread
From: Michael Nosthoff @ 2018-03-09  9:01 UTC (permalink / raw)
  To: linux-iio

Commit 585ed27d removed code which was unused due to a bug in
commit 7383d44b. To fix this bug the code is needed. Thus this
revert.

This reverts commit 585ed27d06151f98e39238298f43ee261314ae74.
Signed-off-by: Michael Nosthoff <committed@heine.so>
---
  drivers/iio/accel/st_accel_core.c | 5 +++++
  1 file changed, 5 insertions(+)

diff --git a/drivers/iio/accel/st_accel_core.c 
b/drivers/iio/accel/st_accel_core.c
index 6fe995c..460aa58 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;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-03-09  9:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-09  9:01 [PATCH 1/2] iio: accel: Revert "iio: accel: st_accel: remove redundant pointer pdata" Michael Nosthoff

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.