Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@cam.ac.uk>
To: Roland Stigge <rst@work-microwave.de>
Cc: linux-iio@vger.kernel.org, Greg KH <greg@kroah.com>,
	Roland Stigge <stigge@antcom.de>
Subject: Re: [PATCH] iio: Fixpoint formatted output bugfix
Date: Thu, 13 Jan 2011 11:09:04 +0000	[thread overview]
Message-ID: <4D2EDD50.7060508@cam.ac.uk> (raw)
In-Reply-To: <1294908733-20354-1-git-send-email-rst@work-microwave.de>

On 01/13/11 08:52, Roland Stigge wrote:
> From: Roland Stigge <stigge@antcom.de>
> 
> Fix some ADC drivers' _scale interface to correct fixpoint formatted output
> 
> Signed-off-by: Roland Stigge <stigge@antcom.de>
> Acked-by: "Hennerich, Michael" <Michael.Hennerich@analog.com>
Acked-by: "Jonathan Cameron <jic23@cam.ac.uk>"

Greg, this is a simple bug fix. The ad7476 and ad799x are in 2.6.37
so it would be good to push this to stable as well.
Do you want a broken out patch with just those two in it?

> 
> ---
>  drivers/staging/iio/adc/ad7476_core.c |    2 +-
>  drivers/staging/iio/adc/ad7887_core.c |    2 +-
>  drivers/staging/iio/adc/ad799x_core.c |    2 +-
>  drivers/staging/iio/dac/ad5446.c      |    2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/ad7476_core.c b/drivers/staging/iio/adc/ad7476_core.c
> index deb68c8..b8b54da 100644
> --- a/drivers/staging/iio/adc/ad7476_core.c
> +++ b/drivers/staging/iio/adc/ad7476_core.c
> @@ -68,7 +68,7 @@ static ssize_t ad7476_show_scale(struct device *dev,
>  	/* Corresponds to Vref / 2^(bits) */
>  	unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits;
>  
> -	return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000);
> +	return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000);
>  }
>  static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad7476_show_scale, NULL, 0);
>  
> diff --git a/drivers/staging/iio/adc/ad7887_core.c b/drivers/staging/iio/adc/ad7887_core.c
> index 6859089..5d85efa 100644
> --- a/drivers/staging/iio/adc/ad7887_core.c
> +++ b/drivers/staging/iio/adc/ad7887_core.c
> @@ -68,7 +68,7 @@ static ssize_t ad7887_show_scale(struct device *dev,
>  	/* Corresponds to Vref / 2^(bits) */
>  	unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits;
>  
> -	return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000);
> +	return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000);
>  }
>  static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad7887_show_scale, NULL, 0);
>  
> diff --git a/drivers/staging/iio/adc/ad799x_core.c b/drivers/staging/iio/adc/ad799x_core.c
> index 6309d52..89ccf37 100644
> --- a/drivers/staging/iio/adc/ad799x_core.c
> +++ b/drivers/staging/iio/adc/ad799x_core.c
> @@ -432,7 +432,7 @@ static ssize_t ad799x_show_scale(struct device *dev,
>  	/* Corresponds to Vref / 2^(bits) */
>  	unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits;
>  
> -	return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000);
> +	return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000);
>  }
>  
>  static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad799x_show_scale, NULL, 0);
> diff --git a/drivers/staging/iio/dac/ad5446.c b/drivers/staging/iio/dac/ad5446.c
> index e3387cd..0f87eca 100644
> --- a/drivers/staging/iio/dac/ad5446.c
> +++ b/drivers/staging/iio/dac/ad5446.c
> @@ -87,7 +87,7 @@ static ssize_t ad5446_show_scale(struct device *dev,
>  	/* Corresponds to Vref / 2^(bits) */
>  	unsigned int scale_uv = (st->vref_mv * 1000) >> st->chip_info->bits;
>  
> -	return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000);
> +	return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000);
>  }
>  static IIO_DEVICE_ATTR(out_scale, S_IRUGO, ad5446_show_scale, NULL, 0);
>  


  reply	other threads:[~2011-01-13 11:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-13  8:52 [PATCH] iio: Fixpoint formatted output bugfix Roland Stigge
2011-01-13 11:09 ` Jonathan Cameron [this message]
2011-01-13 16:49   ` Greg KH
2011-01-13 17:41     ` Roland Stigge
  -- strict thread matches above, loose matches on Subject: below --
2011-01-13 17:37 Roland Stigge
2011-01-13 20:32 ` Hennerich, Michael
2011-01-12 18:35 Roland Stigge
2011-01-13  8:33 ` Hennerich, Michael

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=4D2EDD50.7060508@cam.ac.uk \
    --to=jic23@cam.ac.uk \
    --cc=greg@kroah.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=rst@work-microwave.de \
    --cc=stigge@antcom.de \
    /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