From: Lars-Peter Clausen <lars@metafoo.de>
To: Denis Ciocca <denis.ciocca@gmail.com>
Cc: jic23@kernel.org, linux-iio@vger.kernel.org,
Denis Ciocca <denis.ciocca@st.com>
Subject: Re: [PATCH 1/4] iio:common: Add STMicroelectronics common library
Date: Tue, 29 Jan 2013 22:45:24 +0100 [thread overview]
Message-ID: <510842F4.1020008@metafoo.de> (raw)
In-Reply-To: <1359157488-15969-2-git-send-email-denis.ciocca@st.com>
Hi,
here is one of the rough edges I was talking about earlier.
On 01/26/2013 12:44 AM, Denis Ciocca wrote:
> +int st_sensors_get_sampling_frequency_avl(struct iio_dev *indio_dev, char *buf)
> +{
> + int i, len = 0;
> + struct st_sensor_data *sdata = iio_priv(indio_dev);
> +
> + mutex_lock(&indio_dev->mlock);
> + for (i = 0; i < ST_SENSORS_ODR_LIST_MAX; i++) {
> + if (sdata->sensor->odr.odr_avl[i].hz == 0)
> + break;
> +
> + len += scnprintf(buf + len, PAGE_SIZE - len, "%d ",
> + sdata->sensor->odr.odr_avl[i].hz);
> + }
> + mutex_unlock(&indio_dev->mlock);
> + buf[len - 1] = '\n';
> +
> + return len;
> +}
> +EXPORT_SYMBOL(st_sensors_get_sampling_frequency_avl);
This function is no longer used outside the st_sensors core module, so there is
no need to export it anymore. In fact it is only used in
st_sensors_sysfs_sampling_frequency_avail, which itself is not more than the
call to st_sensors_get_sampling_frequency_avl, so I'd just move the contents of
st_sensors_get_sampling_frequency_avl to st_sensors_sysfs_sampling_frequency_avail.
> +
> +int st_sensors_get_scale_avl(struct iio_dev *indio_dev, char *buf)
> +{
> + int i, len = 0;
> + struct st_sensor_data *sdata = iio_priv(indio_dev);
> +
> + mutex_lock(&indio_dev->mlock);
> + for (i = 0; i < ST_SENSORS_FULLSCALE_AVL_MAX; i++) {
> + if (sdata->sensor->fs.fs_avl[i].num == 0)
> + break;
> +
> + len += scnprintf(buf + len, PAGE_SIZE - len, "0.%06u ",
> + sdata->sensor->fs.fs_avl[i].gain);
> + }
> + mutex_unlock(&indio_dev->mlock);
> + buf[len - 1] = '\n';
> +
> + return len;
> +}
> +EXPORT_SYMBOL(st_sensors_get_scale_avl);
Similar here.
> +
[...]
next prev parent reply other threads:[~2013-01-29 21:43 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-25 23:44 STMicroelectronics IIO driver Denis Ciocca
2013-01-25 23:44 ` [PATCH 1/4] iio:common: Add STMicroelectronics common library Denis Ciocca
2013-01-29 21:45 ` Lars-Peter Clausen [this message]
2013-01-25 23:44 ` [PATCH 2/4] iio:accel: Add STMicroelectronics accelerometers driver Denis Ciocca
2013-01-25 23:44 ` [PATCH 3/4] iio:gyro: Add STMicroelectronics gyroscopes driver Denis Ciocca
2013-01-25 23:44 ` [PATCH 4/4] iio:magnetometer: Add STMicroelectronics magnetometers driver Denis Ciocca
2013-01-28 14:31 ` STMicroelectronics IIO driver Lars-Peter Clausen
2013-01-28 20:14 ` Jonathan Cameron
2013-01-29 9:51 ` Denis CIOCCA
2013-01-30 21:28 ` Jonathan Cameron
2013-01-31 10:18 ` Denis CIOCCA
2013-01-29 9:55 ` Denis CIOCCA
-- strict thread matches above, loose matches on Subject: below --
2013-01-21 8:36 STMicroelectronics driver kconfig-makefile bugfix Denis CIOCCA
2013-01-21 8:36 ` [PATCH 1/4] iio:common: Add STMicroelectronics common library Denis CIOCCA
2013-01-22 16:15 ` Jonathan Cameron
2013-01-23 9:33 ` Lars-Peter Clausen
2013-01-18 16:58 STMicroelectronics drivers Denis CIOCCA
2013-01-18 16:58 ` [PATCH 1/4] iio:common: Add STMicroelectronics common library Denis CIOCCA
2013-01-18 9:31 STMicroelectronics drivers bugfix Denis CIOCCA
2013-01-18 9:31 ` [PATCH 1/4] iio:common: Add STMicroelectronics common library Denis CIOCCA
2013-01-09 12:06 iio: STMicroelectronics iio drivers bugfix Denis CIOCCA
2013-01-09 12:06 ` [PATCH 1/4] iio:common: Add STMicroelectronics common library Denis CIOCCA
2013-01-12 21:59 ` Jonathan Cameron
2013-01-08 16:30 iio: STMicroelectronics iio drivers Denis CIOCCA
2013-01-08 16:30 ` [PATCH 1/4] iio:common: Add STMicroelectronics common library Denis CIOCCA
2012-12-13 13:11 STMicroelectronics sensors driver Denis CIOCCA
2012-12-13 13:11 ` [PATCH 1/4] iio:common: Add STMicroelectronics common library Denis CIOCCA
2012-12-16 12:15 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=510842F4.1020008@metafoo.de \
--to=lars@metafoo.de \
--cc=denis.ciocca@gmail.com \
--cc=denis.ciocca@st.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).