From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Cameron Subject: Re: [PATCH 2/4] iio: common: st_sensors: check odr address value in st_sensors_set_odr() Date: Tue, 10 Oct 2017 20:40:01 +0100 Message-ID: <20171010204001.76065029@archlinux> References: <20170917161712.14645-1-lorenzo.bianconi@st.com> <20170917161712.14645-3-lorenzo.bianconi@st.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20170917161712.14645-3-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Lorenzo Bianconi Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, lorenzo.bianconi-qxv4g6HH51o@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: devicetree@vger.kernel.org On Sun, 17 Sep 2017 18:17:10 +0200 Lorenzo Bianconi wrote: > Do not try to configure sample frequency if the sensor do not export > odr register address in register map. That change will be used to > properly support LIS3DHH accel sensor. > > Signed-off-by: Lorenzo Bianconi Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > drivers/iio/common/st_sensors/st_sensors_core.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c > index 40dfdfc0906b..57db19182e95 100644 > --- a/drivers/iio/common/st_sensors/st_sensors_core.c > +++ b/drivers/iio/common/st_sensors/st_sensors_core.c > @@ -93,6 +93,9 @@ int st_sensors_set_odr(struct iio_dev *indio_dev, unsigned int odr) > struct st_sensor_odr_avl odr_out = {0, 0}; > struct st_sensor_data *sdata = iio_priv(indio_dev); > > + if (!sdata->sensor_settings->odr.addr) > + return 0; > + > err = st_sensors_match_odr(sdata->sensor_settings, odr, &odr_out); > if (err < 0) > goto st_sensors_match_odr_error; -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html