From: Jonathan Cameron <jic23@kernel.org>
To: Peter Meerwald <pmeerw@pmeerw.net>
Cc: linux-iio@vger.kernel.org, Shubhrajyoti Datta <shubhrajyoti@ti.com>
Subject: Re: [PATCH 7/9] staging:iio:hmc5843: Split and join lines to make checkpatch happy
Date: Sun, 04 Aug 2013 11:15:08 +0100 [thread overview]
Message-ID: <51FE29AC.7030606@kernel.org> (raw)
In-Reply-To: <1374939112-18237-8-git-send-email-pmeerw@pmeerw.net>
On 07/27/13 16:31, Peter Meerwald wrote:
> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
> Cc: Shubhrajyoti Datta <shubhrajyoti@ti.com>
Err. Peter, this puts the sampling frequency attribute
back to its original full name (correctly) which I would
imagine was meant to be in the previous patch?
Jonathan
> ---
> drivers/staging/iio/magnetometer/hmc5843.c | 38 ++++++++++++------------------
> 1 file changed, 15 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/staging/iio/magnetometer/hmc5843.c b/drivers/staging/iio/magnetometer/hmc5843.c
> index 1ebb8f8..52d6340 100644
> --- a/drivers/staging/iio/magnetometer/hmc5843.c
> +++ b/drivers/staging/iio/magnetometer/hmc5843.c
> @@ -194,18 +194,15 @@ struct hmc5843_data {
> };
>
> /* The lower two bits contain the current conversion mode */
> -static s32 hmc5843_configure(struct i2c_client *client,
> - u8 operating_mode)
> +static s32 hmc5843_configure(struct i2c_client *client, u8 operating_mode)
> {
> - return i2c_smbus_write_byte_data(client,
> - HMC5843_MODE_REG,
> + return i2c_smbus_write_byte_data(client, HMC5843_MODE_REG,
> operating_mode & HMC5843_MODE_MASK);
> }
>
> /* Return the measurement value from the specified channel */
> static int hmc5843_read_measurement(struct iio_dev *indio_dev,
> - int address,
> - int *val)
> + int address, int *val)
> {
> struct i2c_client *client = to_i2c_client(indio_dev->dev.parent);
> struct hmc5843_data *data = iio_priv(indio_dev);
> @@ -321,8 +318,7 @@ static IIO_DEVICE_ATTR(operating_mode,
> * and BN.
> *
> */
> -static s32 hmc5843_set_meas_conf(struct i2c_client *client,
> - u8 meas_conf)
> +static s32 hmc5843_set_meas_conf(struct i2c_client *client, u8 meas_conf)
> {
> struct iio_dev *indio_dev = i2c_get_clientdata(client);
> struct hmc5843_data *data = iio_priv(indio_dev);
> @@ -332,7 +328,7 @@ static s32 hmc5843_set_meas_conf(struct i2c_client *client,
> return i2c_smbus_write_byte_data(client, HMC5843_CONFIG_REG_A, reg_val);
> }
>
> -static ssize_t hmc5843_show_measurement_configuration(struct device *dev,
> +static ssize_t hmc5843_show_measurement_conf(struct device *dev,
> struct device_attribute *attr,
> char *buf)
> {
> @@ -341,10 +337,9 @@ static ssize_t hmc5843_show_measurement_configuration(struct device *dev,
> return sprintf(buf, "%d\n", data->meas_conf);
> }
>
> -static ssize_t hmc5843_set_measurement_configuration(struct device *dev,
> +static ssize_t hmc5843_set_measurement_conf(struct device *dev,
> struct device_attribute *attr,
> - const char *buf,
> - size_t count)
> + const char *buf, size_t count)
> {
> struct iio_dev *indio_dev = dev_to_iio_dev(dev);
> struct i2c_client *client = to_i2c_client(indio_dev->dev.parent);
> @@ -398,8 +393,7 @@ static ssize_t hmc5843_show_sampling_freq_available(struct device *dev,
>
> static IIO_DEV_ATTR_SAMP_FREQ_AVAIL(hmc5843_show_sampling_freq_available);
>
> -static s32 hmc5843_set_rate(struct i2c_client *client,
> - u8 rate)
> +static s32 hmc5843_set_rate(struct i2c_client *client, u8 rate)
> {
> struct iio_dev *indio_dev = i2c_get_clientdata(client);
> struct hmc5843_data *data = iio_priv(indio_dev);
> @@ -475,9 +469,8 @@ static ssize_t hmc5843_show_sampling_freq(struct device *dev,
> return sprintf(buf, "%s\n", data->variant->regval_to_sample_freq[rate]);
> }
>
> -static IIO_DEVICE_ATTR(sampling_freq, S_IWUSR | S_IRUGO,
> - hmc5843_show_sampling_freq,
> - hmc5843_set_sampling_freq,
> +static IIO_DEVICE_ATTR(sampling_frequency, S_IWUSR | S_IRUGO,
> + hmc5843_show_sampling_freq, hmc5843_set_sampling_freq,
> HMC5843_CONFIG_REG_A);
>
> static ssize_t hmc5843_show_range_gain(struct device *dev,
> @@ -489,7 +482,8 @@ static ssize_t hmc5843_show_range_gain(struct device *dev,
> struct hmc5843_data *data = iio_priv(indio_dev);
>
> range = data->range;
> - return sprintf(buf, "%d\n", data->variant->regval_to_input_field_mga[range]);
> + return sprintf(buf, "%d\n",
> + data->variant->regval_to_input_field_mga[range]);
> }
>
> static ssize_t hmc5843_set_range_gain(struct device *dev,
> @@ -527,10 +521,8 @@ exit:
> return count;
> }
>
> -static IIO_DEVICE_ATTR(in_magn_range,
> - S_IWUSR | S_IRUGO,
> - hmc5843_show_range_gain,
> - hmc5843_set_range_gain,
> +static IIO_DEVICE_ATTR(in_magn_range, S_IWUSR | S_IRUGO,
> + hmc5843_show_range_gain, hmc5843_set_range_gain,
> HMC5843_CONFIG_REG_B);
>
> static int hmc5843_read_raw(struct iio_dev *indio_dev,
> @@ -578,7 +570,7 @@ static const struct iio_chan_spec hmc5883_channels[] = {
> static struct attribute *hmc5843_attributes[] = {
> &iio_dev_attr_measurement_configuration.dev_attr.attr,
> &iio_dev_attr_operating_mode.dev_attr.attr,
> - &iio_dev_attr_sampling_freq.dev_attr.attr,
> + &iio_dev_attr_sampling_frequency.dev_attr.attr,
> &iio_dev_attr_in_magn_range.dev_attr.attr,
> &iio_dev_attr_sampling_frequency_available.dev_attr.attr,
> NULL
>
next prev parent reply other threads:[~2013-08-04 9:15 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-27 15:31 Peter Meerwald
2013-07-27 15:31 ` [PATCH 1/9] staging:iio:hmc5843: Drop I2C detection code Peter Meerwald
2013-08-04 10:01 ` Jonathan Cameron
2013-07-27 15:31 ` [PATCH 2/9] staging:iio:hmc5843: Remove id register #defines, not used anymore Peter Meerwald
2013-08-04 10:02 ` Jonathan Cameron
2013-07-27 15:31 ` [PATCH 3/9] staging:iio:hmc5843: Implement timeout in read function Peter Meerwald
2013-08-04 10:03 ` Jonathan Cameron
2013-07-27 15:31 ` [PATCH 4/9] staging:iio:hmc5843: 'add' is a poor abbreviation for address Peter Meerwald
2013-08-04 10:04 ` Jonathan Cameron
2013-07-27 15:31 ` [PATCH 5/9] staging:iio:hmc5843: Device has 3 channels, no need to store separately Peter Meerwald
2013-08-04 10:10 ` Jonathan Cameron
2013-07-27 15:31 ` [PATCH 6/9] staging:iio:hmc5843: Trim sampling_frequencies to sampling_freq Peter Meerwald
2013-07-27 18:01 ` Jonathan Cameron
2013-08-04 10:13 ` Jonathan Cameron
2013-07-27 15:31 ` [PATCH 7/9] staging:iio:hmc5843: Split and join lines to make checkpatch happy Peter Meerwald
2013-08-04 10:15 ` Jonathan Cameron [this message]
2013-07-27 15:31 ` [PATCH 8/9] staging:iio:hmc5843: Drop unneeded #includes Peter Meerwald
2013-08-04 10:22 ` Jonathan Cameron
2013-07-27 15:31 ` [PATCH 9/9] staging:iio:hmc5843: Use i2c_smbus_read_word_swapped() Peter Meerwald
2013-08-04 10:23 ` 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=51FE29AC.7030606@kernel.org \
--to=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
--cc=shubhrajyoti@ti.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.