All of lore.kernel.org
 help / color / mirror / Atom feed
From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/6] mfd: mc13xxx-core: ADC conv: clear ADC_WORKING flag for invalid mode
Date: Mon, 30 Jan 2012 08:27:56 +0100	[thread overview]
Message-ID: <20120130072756.GH6305@pengutronix.de> (raw)
In-Reply-To: <1327876408-22528-5-git-send-email-marc@cpdesign.com.au>

On Mon, Jan 30, 2012 at 09:33:26AM +1100, Marc Reilly wrote:
> Requesting a conversion for and invalid mode would mean that the
s/and/an/

> MC13XXX_ADC_WORKING flag never gets cleared.
> 
> Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
> ---
>  drivers/mfd/mc13xxx-core.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c
> index 56e09ea..61a767d 100644
> --- a/drivers/mfd/mc13xxx-core.c
> +++ b/drivers/mfd/mc13xxx-core.c
> @@ -557,8 +557,9 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, unsigned int mode,
>  		break;
>  
>  	default:
> -		mc13xxx_unlock(mc13xxx);
> -		return -EINVAL;
> +		dev_warn(mc13xxx->dev, "%s: bad ADC mode requested\n", __func__);
> +		ret = -EINVAL;
> +		goto out_flag;
I would prefer this to be named in a more descritive way. Maybe
"out_clear_working"?

Other than that, ack.

Uwe
>  	}
>  
>  	dev_dbg(mc13xxx->dev, "%s: request irq\n", __func__);
> @@ -608,6 +609,7 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, unsigned int mode,
>  		/* restore TSMOD */
>  		mc13xxx_reg_write(mc13xxx, MC13XXX_ADC0, old_adc0);
>  
> +out_flag:
>  	mc13xxx->adcflags &= ~MC13XXX_ADC_WORKING;
>  out:
>  	mc13xxx_unlock(mc13xxx);
> -- 
> 1.7.3.4
> 
> 

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

  reply	other threads:[~2012-01-30  7:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-29 22:33 mfd: mc13xxx adc fixes and enhancements Marc Reilly
2012-01-29 22:33 ` [PATCH 1/6] mfd: mc13xxx-core: ADC conv: ack existing pending irqs before requesting Marc Reilly
2012-01-30  7:15   ` Uwe Kleine-König
2012-01-30 23:08     ` Marc Reilly
2012-01-29 22:33 ` [PATCH 2/6] mfd: mc13xxx-core: ADC conv: wait_for_completion returns a long Marc Reilly
2012-01-30  7:24   ` Uwe Kleine-König
2012-01-30 21:40     ` Marc Reilly
2012-01-31  8:07       ` Uwe Kleine-König
2012-02-09 10:40         ` Uwe Kleine-König
2012-01-29 22:33 ` [PATCH 3/6] mfd: mc13xxx-core: ADC conv: setup readout for single channel Marc Reilly
2012-01-29 22:33 ` [PATCH 4/6] mfd: mc13xxx-core: ADC conv: clear ADC_WORKING flag for invalid mode Marc Reilly
2012-01-30  7:27   ` Uwe Kleine-König [this message]
2012-01-29 22:33 ` [PATCH 5/6] mfd: mc13xxx-core: ADC conv: only preserve TSMOD if TS in interrupt mode Marc Reilly
2012-01-29 22:33 ` [PATCH 6/6] mfd: mc13xxx-core: ADC conversion with extra capabilities Marc Reilly
2012-01-30  8:07 ` mfd: mc13xxx adc fixes and enhancements Uwe Kleine-König
2012-02-10  7:58   ` Robin van der Gracht

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=20120130072756.GH6305@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.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.