diff options
author | Lee Jones <lee.jones@linaro.org> | 2013-09-10 14:49:00 +0200 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-09-14 22:17:15 +0200 |
commit | 362f2f8647cfa53e36bf910b42ad084674ade9dc (patch) | |
tree | fdd383ab58e2d9e28d7bf3466e1e641690c54f39 /drivers/iio/common | |
parent | iio: Add tsl4531 ambient light sensor driver (diff) | |
download | linux-362f2f8647cfa53e36bf910b42ad084674ade9dc.tar.xz linux-362f2f8647cfa53e36bf910b42ad084674ade9dc.zip |
iio: sensors-core: st: Allow full-scale to be an optional feature
Some chips either don't support it or fail to provide adequate documentation,
so sometimes it's impossible to enable the feature even if it is supported.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/common')
-rw-r--r-- | drivers/iio/common/st_sensors/st_sensors_core.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c index 965ee22d3ac8..eb261a58fc68 100644 --- a/drivers/iio/common/st_sensors/st_sensors_core.c +++ b/drivers/iio/common/st_sensors/st_sensors_core.c @@ -235,10 +235,13 @@ int st_sensors_init_sensor(struct iio_dev *indio_dev, if (err < 0) goto init_error; - err = st_sensors_set_fullscale(indio_dev, - sdata->current_fullscale->num); - if (err < 0) - goto init_error; + if (sdata->current_fullscale) { + err = st_sensors_set_fullscale(indio_dev, + sdata->current_fullscale->num); + if (err < 0) + goto init_error; + } else + dev_info(&indio_dev->dev, "Full-scale not possible\n"); err = st_sensors_set_odr(indio_dev, sdata->odr); if (err < 0) |