From: Jonathan Cameron <jic23@kernel.org>
To: Hartmut Knaack <knaack.h@gmx.de>, linux-iio@vger.kernel.org
Cc: Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald <pmeerw@pmeerw.net>,
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Subject: Re: [PATCH 5/6] iio:dac:m62332: address some style issues
Date: Sun, 11 Oct 2015 15:45:07 +0100 [thread overview]
Message-ID: <561A75F3.5090109@kernel.org> (raw)
In-Reply-To: <b13c6db25dbc9e82017692089b0bf26795f1deba.1440459082.git.knaack.h@gmx.de>
On 28/08/15 22:59, Hartmut Knaack wrote:
> Fix some indentation issues and separate returns by empty lines (IIO
> style). Also rename the channel mask in _read_raw() to mask.
>
> Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Applied to the togreg branch of iio.git
Thanks,
Jonathan
> ---
> drivers/iio/dac/m62332.c | 16 +++++++++++-----
> 1 file changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/dac/m62332.c b/drivers/iio/dac/m62332.c
> index 1b65fc007bce..fdb3e042c14d 100644
> --- a/drivers/iio/dac/m62332.c
> +++ b/drivers/iio/dac/m62332.c
> @@ -40,8 +40,7 @@ struct m62332_data {
> #endif
> };
>
> -static int m62332_set_value(struct iio_dev *indio_dev,
> - u8 val, int channel)
> +static int m62332_set_value(struct iio_dev *indio_dev, u8 val, int channel)
> {
> struct m62332_data *data = iio_priv(indio_dev);
> struct i2c_client *client = data->client;
> @@ -87,30 +86,35 @@ static int m62332_read_raw(struct iio_dev *indio_dev,
> struct iio_chan_spec const *chan,
> int *val,
> int *val2,
> - long m)
> + long mask)
> {
> struct m62332_data *data = iio_priv(indio_dev);
>
> - switch (m) {
> + switch (mask) {
> case IIO_CHAN_INFO_SCALE:
> /* Corresponds to Vref / 2^(bits) */
> *val = data->vref_mv;
> *val2 = 8;
> +
> return IIO_VAL_FRACTIONAL_LOG2;
> case IIO_CHAN_INFO_RAW:
> *val = data->raw[chan->channel];
> +
> return IIO_VAL_INT;
> case IIO_CHAN_INFO_OFFSET:
> *val = 1;
> +
> return IIO_VAL_INT;
> default:
> break;
> }
> +
> return -EINVAL;
> }
>
> static int m62332_write_raw(struct iio_dev *indio_dev,
> - struct iio_chan_spec const *chan, int val, int val2, long mask)
> + struct iio_chan_spec const *chan, int val, int val2,
> + long mask)
> {
> switch (mask) {
> case IIO_CHAN_INFO_RAW:
> @@ -195,6 +199,7 @@ static int m62332_probe(struct i2c_client *client,
> indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
> if (!indio_dev)
> return -ENOMEM;
> +
> data = iio_priv(indio_dev);
> i2c_set_clientdata(client, indio_dev);
> data->client = client;
> @@ -230,6 +235,7 @@ static int m62332_probe(struct i2c_client *client,
>
> err:
> iio_map_array_unregister(indio_dev);
> +
> return ret;
> }
>
>
next prev parent reply other threads:[~2015-10-11 14:45 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-28 21:59 [PATCH 0/6] fixes, cleanup and improvements for m62332 Hartmut Knaack
2015-08-28 21:59 ` [PATCH 1/6] iio:dac:m62332: share scale and offset Hartmut Knaack
2015-08-31 14:53 ` Jonathan Cameron
2015-09-12 10:11 ` Jonathan Cameron
2015-09-12 10:14 ` Jonathan Cameron
2015-09-27 15:56 ` Jonathan Cameron
2015-10-11 14:40 ` Jonathan Cameron
2015-08-28 21:59 ` [PATCH 2/6] iio:dac:m62332: shutdown on remove Hartmut Knaack
2015-08-31 12:56 ` Daniel Baluta
2015-08-31 19:26 ` Hartmut Knaack
2015-10-11 14:42 ` Jonathan Cameron
2015-08-28 21:59 ` [PATCH 3/6] iio:dac:m62332: use ARRAY_SIZE Hartmut Knaack
2015-08-31 12:58 ` Daniel Baluta
2015-10-11 14:43 ` Jonathan Cameron
2015-08-28 21:59 ` [PATCH 4/6] iio:dac:m62332: drop unrequired variable Hartmut Knaack
2015-08-31 19:46 ` Daniel Baluta
2015-10-11 14:44 ` Jonathan Cameron
2015-08-28 21:59 ` [PATCH 5/6] iio:dac:m62332: address some style issues Hartmut Knaack
2015-10-11 14:45 ` Jonathan Cameron [this message]
2015-08-28 21:59 ` [PATCH 6/6] iio:dac:m62332: use dynamic scale Hartmut Knaack
2015-10-11 14:46 ` Jonathan Cameron
2015-08-31 15:00 ` [PATCH 0/6] fixes, cleanup and improvements for m62332 Jonathan Cameron
2015-08-31 16:09 ` Dmitry Eremin-Solenikov
2015-09-12 10:13 ` Jonathan Cameron
2015-10-03 11:16 ` Jonathan Cameron
2015-10-11 14:38 ` 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=561A75F3.5090109@kernel.org \
--to=jic23@kernel.org \
--cc=dbaryshkov@gmail.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/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).