All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <guenter.roeck@ericsson.com>
To: Jonathan Cameron <jic23@cam.ac.uk>
Cc: "fabien.marteau@armadeus.com" <fabien.marteau@armadeus.com>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"lm-sensors@lm-sensors.org" <lm-sensors@lm-sensors.org>
Subject: Re: [PATCH 1/2] staging:iio:adc: as1531 driver initial conversion from hwmon submission.
Date: Wed, 18 May 2011 09:02:02 -0700	[thread overview]
Message-ID: <20110518160202.GC11280@ericsson.com> (raw)
In-Reply-To: <1305733172-18519-2-git-send-email-jic23@cam.ac.uk>

On Wed, May 18, 2011 at 11:39:31AM -0400, Jonathan Cameron wrote:
> From: Fabien Marteau <fabien.marteau@armadeus.com>
> 
> Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>

Hi Jonathan,

nice job. Thanks a lot for the effort.

[ ... ]

> +static int as1531_read_raw(struct iio_dev *indio_dev,
> +			   struct iio_chan_spec const *chan,
> +			   int *val,
> +			   int *val2,
> +			   long m)
> +{
> +
Extra blank line

> +	int status = 0;
> +	int ret_value = 0;
> +	struct as1531_state *st = iio_priv(indio_dev);

Move it to here, maybe ?

> +	if (mutex_lock_interruptible(&st->lock))
> +		return -ERESTARTSYS;
> +
> +	status = as1531_message(st->spi,
> +				AS1531_START_BIT | chan->address |
> +				AS1531_RANGE_0_TO_VREF | AS1531_MODE_COM |
> +				AS1531_POWER_NORMAL,
> +				&ret_value);
> +	mutex_unlock(&st->lock);
> +	if (status < 0)
> +		goto out;
> +	
> +	*val = ret_value*2500/4096;
> +
> +	return IIO_VAL_INT;
> +out:
> +	mutex_unlock(&st->lock);

Mutex was unlocked above already. Maybe just return status above ?

Thanks,
Guenter 

WARNING: multiple messages have this Message-ID (diff)
From: Guenter Roeck <guenter.roeck@ericsson.com>
To: Jonathan Cameron <jic23@cam.ac.uk>
Cc: "fabien.marteau@armadeus.com" <fabien.marteau@armadeus.com>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"lm-sensors@lm-sensors.org" <lm-sensors@lm-sensors.org>
Subject: Re: [lm-sensors] [PATCH 1/2] staging:iio:adc: as1531 driver initial
Date: Wed, 18 May 2011 16:02:02 +0000	[thread overview]
Message-ID: <20110518160202.GC11280@ericsson.com> (raw)
In-Reply-To: <1305733172-18519-2-git-send-email-jic23@cam.ac.uk>

On Wed, May 18, 2011 at 11:39:31AM -0400, Jonathan Cameron wrote:
> From: Fabien Marteau <fabien.marteau@armadeus.com>
> 
> Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>

Hi Jonathan,

nice job. Thanks a lot for the effort.

[ ... ]

> +static int as1531_read_raw(struct iio_dev *indio_dev,
> +			   struct iio_chan_spec const *chan,
> +			   int *val,
> +			   int *val2,
> +			   long m)
> +{
> +
Extra blank line

> +	int status = 0;
> +	int ret_value = 0;
> +	struct as1531_state *st = iio_priv(indio_dev);

Move it to here, maybe ?

> +	if (mutex_lock_interruptible(&st->lock))
> +		return -ERESTARTSYS;
> +
> +	status = as1531_message(st->spi,
> +				AS1531_START_BIT | chan->address |
> +				AS1531_RANGE_0_TO_VREF | AS1531_MODE_COM |
> +				AS1531_POWER_NORMAL,
> +				&ret_value);
> +	mutex_unlock(&st->lock);
> +	if (status < 0)
> +		goto out;
> +	
> +	*val = ret_value*2500/4096;
> +
> +	return IIO_VAL_INT;
> +out:
> +	mutex_unlock(&st->lock);

Mutex was unlocked above already. Maybe just return status above ?

Thanks,
Guenter 

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

  reply	other threads:[~2011-05-18 16:02 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-16 13:39 [lm-sensors] [PATCH] hwmon: Driver for as1531, fabien.marteau
2011-05-16 13:39 ` [PATCH] hwmon: Driver for as1531, Austria-Microsystem Analog to Digital Converter fabien.marteau
2011-05-16 15:01 ` [lm-sensors] [PATCH] hwmon: Driver for as1531, Randy Dunlap
2011-05-16 15:01   ` [PATCH] hwmon: Driver for as1531, Austria-Microsystem Analog to Digital Converter Randy Dunlap
2011-05-16 15:39 ` [lm-sensors] [PATCH] hwmon: Driver for as1531, Guenter Roeck
2011-05-16 15:39   ` [PATCH] hwmon: Driver for as1531, Austria-Microsystem Analog to Digital Converter Guenter Roeck
2011-05-17  7:06   ` [lm-sensors] [PATCH] hwmon: Driver for as1531, Fabien Marteau
2011-05-17  7:06     ` [PATCH] hwmon: Driver for as1531, Austria-Microsystem Analog to Digital Converter Fabien Marteau
2011-05-17  9:25     ` [lm-sensors] [PATCH] hwmon: Driver for as1531, Jonathan Cameron
2011-05-17  9:25       ` [PATCH] hwmon: Driver for as1531, Austria-Microsystem Analog to Digital Converter Jonathan Cameron
2011-05-17  9:34       ` [lm-sensors] [PATCH] hwmon: Driver for as1531, Jonathan Cameron
2011-05-17  9:34         ` [PATCH] hwmon: Driver for as1531, Austria-Microsystem Analog to Digital Converter Jonathan Cameron
2011-05-17 11:59         ` [lm-sensors] [PATCH] hwmon: Driver for as1531, Fabien Marteau
2011-05-17 11:59           ` [PATCH] hwmon: Driver for as1531, Austria-Microsystem Analog to Digital Converter Fabien Marteau
2011-05-18 15:39           ` [PATCH 0/2] staging:iio:adc:as1531 driver port from hwmon driver Jonathan Cameron
2011-05-18 15:39             ` [lm-sensors] [PATCH 0/2] staging:iio:adc:as1531 driver port from Jonathan Cameron
2011-05-18 16:16             ` [PATCH V2 0/2] staging:iio:adc:as1531 driver port from hwmon driver Jonathan Cameron
2011-05-18 16:16               ` [lm-sensors] [PATCH V2 0/2] staging:iio:adc:as1531 driver port from Jonathan Cameron
2011-05-18 17:01               ` [PATCH V2 0/2] staging:iio:adc:as1531 driver port from hwmon driver Fabien Marteau
2011-05-18 17:01                 ` [lm-sensors] [PATCH V2 0/2] staging:iio:adc:as1531 driver port Fabien Marteau
2011-05-18 16:16             ` [PATCH 1/2] staging:iio:adc: as1531 driver initial conversion from hwmon submission Jonathan Cameron
2011-05-18 16:16               ` [lm-sensors] [PATCH 1/2] staging:iio:adc: as1 Jonathan Cameron
2011-05-18 16:37               ` [PATCH 1/2] staging:iio:adc: as1531 driver initial conversion from hwmon submission Guenter Roeck
2011-05-18 16:37                 ` [lm-sensors] [PATCH 1/2] staging:iio:adc: as1531 driver initial Guenter Roeck
2011-05-18 16:17             ` [PATCH 2/2] staging:iio:adc:as1351 general cleanup and conversion to standard functions Jonathan Cameron
2011-05-18 16:17               ` [lm-sensors] [PATCH 2/2] staging:iio:adc:as1351 general cleanup and Jonathan Cameron
2011-05-18 16:35               ` [PATCH 2/2] staging:iio:adc:as1351 general cleanup and conversion to standard functions Guenter Roeck
2011-05-18 16:35                 ` [lm-sensors] [PATCH 2/2] staging:iio:adc:as1351 general cleanup Guenter Roeck
2011-05-19  8:42                 ` [PATCH 2/2] staging:iio:adc:as1351 general cleanup and conversion to standard functions Jonathan Cameron
2011-05-19  8:42                   ` [lm-sensors] [PATCH 2/2] staging:iio:adc:as1351 general cleanup Jonathan Cameron
2011-05-18 15:39           ` [PATCH 1/2] staging:iio:adc: as1531 driver initial conversion from hwmon submission Jonathan Cameron
2011-05-18 15:39             ` [lm-sensors] [PATCH 1/2] staging:iio:adc: as1 Jonathan Cameron
2011-05-18 16:02             ` Guenter Roeck [this message]
2011-05-18 16:02               ` [lm-sensors] [PATCH 1/2] staging:iio:adc: as1531 driver initial Guenter Roeck
2011-05-18 16:12               ` [PATCH 1/2] staging:iio:adc: as1531 driver initial conversion from hwmon submission Jonathan Cameron
2011-05-18 16:12                 ` [lm-sensors] [PATCH 1/2] staging:iio:adc: as1531 driver initial Jonathan Cameron
2011-05-18 15:39           ` [PATCH 2/2] staging:iio:adc:as1351 general cleanup and conversion to standard functions Jonathan Cameron
2011-05-18 15:39             ` [lm-sensors] [PATCH 2/2] staging:iio:adc:as1351 general cleanup and Jonathan Cameron
2011-05-18 15:57             ` [PATCH 2/2] staging:iio:adc:as1351 general cleanup and conversion to standard functions Guenter Roeck
2011-05-18 15:57               ` [lm-sensors] [PATCH 2/2] staging:iio:adc:as1351 general cleanup Guenter Roeck
2011-05-17 13:38       ` [lm-sensors] [PATCH] hwmon: Driver for as1531, Guenter Roeck
2011-05-17 13:38         ` [PATCH] hwmon: Driver for as1531, Austria-Microsystem Analog to Digital Converter Guenter Roeck
2011-05-18 13:09 ` [lm-sensors] [PATCH] hwmon: Driver for as1531, Jonathan Cameron
2011-05-18 13:09   ` [PATCH] hwmon: Driver for as1531, Austria-Microsystem Analog to Digital Converter Jonathan Cameron
2011-05-18 15:05   ` [lm-sensors] [PATCH] hwmon: Driver for as1531, Jonathan Cameron
2011-05-18 15:05     ` [PATCH] hwmon: Driver for as1531, Austria-Microsystem Analog to Digital Converter 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=20110518160202.GC11280@ericsson.com \
    --to=guenter.roeck@ericsson.com \
    --cc=fabien.marteau@armadeus.com \
    --cc=jic23@cam.ac.uk \
    --cc=linux-iio@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.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 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.