diff options
| author | Denis CIOCCA <denis.ciocca@st.com> | 2013-01-30 04:15:00 -0500 |
|---|---|---|
| committer | Jonathan Cameron <jic23@kernel.org> | 2013-02-02 04:37:54 -0500 |
| commit | 4d2e4fc224d0d5e56fdb0baa7cd135d1557b0a25 (patch) | |
| tree | c60c42540c8a9f0d1341ed00afe89d4ee0fb8933 | |
| parent | 9dbf091da080508e9f632d307f357beb79a0766b (diff) | |
iio:common: removed unused functions outside st_sensors library
This patch remove st_sensors_get_sampling_frequency_avl and
st_sensors_get_scale_avl functions used only in
st_sensors_sysfs_sampling_frequency_avail and st_sensors_sysfs_scale_avail
sysfs functions.
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| -rw-r--r-- | drivers/iio/common/st_sensors/st_sensors_core.c | 70 | ||||
| -rw-r--r-- | include/linux/iio/common/st_sensors.h | 4 |
2 files changed, 28 insertions, 46 deletions
diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c index fba6d6847b6d..0198324a8b0c 100644 --- a/drivers/iio/common/st_sensors/st_sensors_core.c +++ b/drivers/iio/common/st_sensors/st_sensors_core.c | |||
| @@ -38,46 +38,6 @@ st_sensors_write_data_with_mask_error: | |||
| 38 | return err; | 38 | return err; |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | int st_sensors_get_sampling_frequency_avl(struct iio_dev *indio_dev, char *buf) | ||
| 42 | { | ||
| 43 | int i, len = 0; | ||
| 44 | struct st_sensor_data *sdata = iio_priv(indio_dev); | ||
| 45 | |||
| 46 | mutex_lock(&indio_dev->mlock); | ||
| 47 | for (i = 0; i < ST_SENSORS_ODR_LIST_MAX; i++) { | ||
| 48 | if (sdata->sensor->odr.odr_avl[i].hz == 0) | ||
| 49 | break; | ||
| 50 | |||
| 51 | len += scnprintf(buf + len, PAGE_SIZE - len, "%d ", | ||
| 52 | sdata->sensor->odr.odr_avl[i].hz); | ||
| 53 | } | ||
| 54 | mutex_unlock(&indio_dev->mlock); | ||
| 55 | buf[len - 1] = '\n'; | ||
| 56 | |||
| 57 | return len; | ||
| 58 | } | ||
| 59 | EXPORT_SYMBOL(st_sensors_get_sampling_frequency_avl); | ||
| 60 | |||
| 61 | int st_sensors_get_scale_avl(struct iio_dev *indio_dev, char *buf) | ||
| 62 | { | ||
| 63 | int i, len = 0; | ||
| 64 | struct st_sensor_data *sdata = iio_priv(indio_dev); | ||
| 65 | |||
| 66 | mutex_lock(&indio_dev->mlock); | ||
| 67 | for (i = 0; i < ST_SENSORS_FULLSCALE_AVL_MAX; i++) { | ||
| 68 | if (sdata->sensor->fs.fs_avl[i].num == 0) | ||
| 69 | break; | ||
| 70 | |||
| 71 | len += scnprintf(buf + len, PAGE_SIZE - len, "0.%06u ", | ||
| 72 | sdata->sensor->fs.fs_avl[i].gain); | ||
| 73 | } | ||
| 74 | mutex_unlock(&indio_dev->mlock); | ||
| 75 | buf[len - 1] = '\n'; | ||
| 76 | |||
| 77 | return len; | ||
| 78 | } | ||
| 79 | EXPORT_SYMBOL(st_sensors_get_scale_avl); | ||
| 80 | |||
| 81 | static int st_sensors_match_odr(struct st_sensors *sensor, | 41 | static int st_sensors_match_odr(struct st_sensors *sensor, |
| 82 | unsigned int odr, struct st_sensor_odr_avl *odr_out) | 42 | unsigned int odr, struct st_sensor_odr_avl *odr_out) |
| 83 | { | 43 | { |
| @@ -440,18 +400,44 @@ EXPORT_SYMBOL(st_sensors_sysfs_set_sampling_frequency); | |||
| 440 | ssize_t st_sensors_sysfs_sampling_frequency_avail(struct device *dev, | 400 | ssize_t st_sensors_sysfs_sampling_frequency_avail(struct device *dev, |
| 441 | struct device_attribute *attr, char *buf) | 401 | struct device_attribute *attr, char *buf) |
| 442 | { | 402 | { |
| 403 | int i, len = 0; | ||
| 443 | struct iio_dev *indio_dev = dev_get_drvdata(dev); | 404 | struct iio_dev *indio_dev = dev_get_drvdata(dev); |
| 405 | struct st_sensor_data *sdata = iio_priv(indio_dev); | ||
| 406 | |||
| 407 | mutex_lock(&indio_dev->mlock); | ||
| 408 | for (i = 0; i < ST_SENSORS_ODR_LIST_MAX; i++) { | ||
| 409 | if (sdata->sensor->odr.odr_avl[i].hz == 0) | ||
| 410 | break; | ||
| 411 | |||
| 412 | len += scnprintf(buf + len, PAGE_SIZE - len, "%d ", | ||
| 413 | sdata->sensor->odr.odr_avl[i].hz); | ||
| 414 | } | ||
| 415 | mutex_unlock(&indio_dev->mlock); | ||
| 416 | buf[len - 1] = '\n'; | ||
| 444 | 417 | ||
| 445 | return st_sensors_get_sampling_frequency_avl(indio_dev, buf); | 418 | return len; |
| 446 | } | 419 | } |
| 447 | EXPORT_SYMBOL(st_sensors_sysfs_sampling_frequency_avail); | 420 | EXPORT_SYMBOL(st_sensors_sysfs_sampling_frequency_avail); |
| 448 | 421 | ||
| 449 | ssize_t st_sensors_sysfs_scale_avail(struct device *dev, | 422 | ssize_t st_sensors_sysfs_scale_avail(struct device *dev, |
| 450 | struct device_attribute *attr, char *buf) | 423 | struct device_attribute *attr, char *buf) |
| 451 | { | 424 | { |
| 425 | int i, len = 0; | ||
| 452 | struct iio_dev *indio_dev = dev_get_drvdata(dev); | 426 | struct iio_dev *indio_dev = dev_get_drvdata(dev); |
| 427 | struct st_sensor_data *sdata = iio_priv(indio_dev); | ||
| 428 | |||
| 429 | mutex_lock(&indio_dev->mlock); | ||
| 430 | for (i = 0; i < ST_SENSORS_FULLSCALE_AVL_MAX; i++) { | ||
| 431 | if (sdata->sensor->fs.fs_avl[i].num == 0) | ||
| 432 | break; | ||
| 433 | |||
| 434 | len += scnprintf(buf + len, PAGE_SIZE - len, "0.%06u ", | ||
| 435 | sdata->sensor->fs.fs_avl[i].gain); | ||
| 436 | } | ||
| 437 | mutex_unlock(&indio_dev->mlock); | ||
| 438 | buf[len - 1] = '\n'; | ||
| 453 | 439 | ||
| 454 | return st_sensors_get_scale_avl(indio_dev, buf); | 440 | return len; |
| 455 | } | 441 | } |
| 456 | EXPORT_SYMBOL(st_sensors_sysfs_scale_avail); | 442 | EXPORT_SYMBOL(st_sensors_sysfs_scale_avail); |
| 457 | 443 | ||
diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h index 3cc85715491f..c40fdf537f69 100644 --- a/include/linux/iio/common/st_sensors.h +++ b/include/linux/iio/common/st_sensors.h | |||
| @@ -243,10 +243,6 @@ int st_sensors_set_enable(struct iio_dev *indio_dev, bool enable); | |||
| 243 | 243 | ||
| 244 | int st_sensors_set_axis_enable(struct iio_dev *indio_dev, u8 axis_enable); | 244 | int st_sensors_set_axis_enable(struct iio_dev *indio_dev, u8 axis_enable); |
| 245 | 245 | ||
| 246 | int st_sensors_get_sampling_frequency_avl(struct iio_dev *indio_dev, char *buf); | ||
| 247 | |||
| 248 | int st_sensors_get_scale_avl(struct iio_dev *indio_dev, char *buf); | ||
| 249 | |||
| 250 | int st_sensors_set_odr(struct iio_dev *indio_dev, unsigned int odr); | 246 | int st_sensors_set_odr(struct iio_dev *indio_dev, unsigned int odr); |
| 251 | 247 | ||
| 252 | int st_sensors_set_dataready_irq(struct iio_dev *indio_dev, bool enable); | 248 | int st_sensors_set_dataready_irq(struct iio_dev *indio_dev, bool enable); |
