diff options
| author | Jonathan Cameron <jic23@kernel.org> | 2014-06-22 15:59:00 -0400 |
|---|---|---|
| committer | Jonathan Cameron <jic23@kernel.org> | 2014-07-07 04:39:57 -0400 |
| commit | 2d239c9e92087d5f4f667371ae350db9f76e3191 (patch) | |
| tree | 114c0ce21c9f9258ee82ac849d15b715265f07b0 /drivers/iio/common | |
| parent | a244e7b57f0fb778bd333b10fffbeb362b94ffc3 (diff) | |
iio:st sensors: remove custom sampling frequence attribute in favour of core support.
This allows in kernel client drivers to access this
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Cc: Denis Ciocca <denis.ciocca@st.com>
Reviewed-by: Hartmut Knaack <knaack.h@gmx.de>
Diffstat (limited to 'drivers/iio/common')
| -rw-r--r-- | drivers/iio/common/st_sensors/st_sensors_core.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c index e8b932fed70e..30fb6407fad0 100644 --- a/drivers/iio/common/st_sensors/st_sensors_core.c +++ b/drivers/iio/common/st_sensors/st_sensors_core.c | |||
| @@ -463,35 +463,6 @@ read_wai_error: | |||
| 463 | } | 463 | } |
| 464 | EXPORT_SYMBOL(st_sensors_check_device_support); | 464 | EXPORT_SYMBOL(st_sensors_check_device_support); |
| 465 | 465 | ||
| 466 | ssize_t st_sensors_sysfs_get_sampling_frequency(struct device *dev, | ||
| 467 | struct device_attribute *attr, char *buf) | ||
| 468 | { | ||
| 469 | struct st_sensor_data *adata = iio_priv(dev_get_drvdata(dev)); | ||
| 470 | |||
| 471 | return sprintf(buf, "%d\n", adata->odr); | ||
| 472 | } | ||
| 473 | EXPORT_SYMBOL(st_sensors_sysfs_get_sampling_frequency); | ||
| 474 | |||
| 475 | ssize_t st_sensors_sysfs_set_sampling_frequency(struct device *dev, | ||
| 476 | struct device_attribute *attr, const char *buf, size_t size) | ||
| 477 | { | ||
| 478 | int err; | ||
| 479 | unsigned int odr; | ||
| 480 | struct iio_dev *indio_dev = dev_get_drvdata(dev); | ||
| 481 | |||
| 482 | err = kstrtoint(buf, 10, &odr); | ||
| 483 | if (err < 0) | ||
| 484 | goto conversion_error; | ||
| 485 | |||
| 486 | mutex_lock(&indio_dev->mlock); | ||
| 487 | err = st_sensors_set_odr(indio_dev, odr); | ||
| 488 | mutex_unlock(&indio_dev->mlock); | ||
| 489 | |||
| 490 | conversion_error: | ||
| 491 | return err < 0 ? err : size; | ||
| 492 | } | ||
| 493 | EXPORT_SYMBOL(st_sensors_sysfs_set_sampling_frequency); | ||
| 494 | |||
| 495 | ssize_t st_sensors_sysfs_sampling_frequency_avail(struct device *dev, | 466 | ssize_t st_sensors_sysfs_sampling_frequency_avail(struct device *dev, |
| 496 | struct device_attribute *attr, char *buf) | 467 | struct device_attribute *attr, char *buf) |
| 497 | { | 468 | { |
