public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Daniel Mack <daniel@caiaq.de>
Cc: linux-kernel@vger.kernel.org, Ville Syrjala <syrjala@sci.fi>,
	Evgeniy Polyakov <johnpol@2ka.mipt.ru>,
	David Brownell <david-b@pacbell.net>
Subject: Re: [PATCH] drivers/w1/masters/w1-gpio.c: fix read_bit()
Date: Mon, 9 Mar 2009 19:14:19 -0700	[thread overview]
Message-ID: <20090309191419.98699220.akpm@linux-foundation.org> (raw)
In-Reply-To: <1236614530-11153-1-git-send-email-daniel@caiaq.de>

On Mon,  9 Mar 2009 17:02:10 +0100 Daniel Mack <daniel@caiaq.de> wrote:

> W1 master implementations are expected to return 0 or 1 from their
> read_bit() function. However, not all platforms do return these values
> from gpio_get_value() - namely PXAs won't. Hence the w1 gpio-master
> needs to break the result down to 0 or 1 itself.
> 
> Signed-off-by: Daniel Mack <daniel@caiaq.de>
> Cc: Ville Syrjala <syrjala@sci.fi>
> Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
> ---
>  drivers/w1/masters/w1-gpio.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/w1/masters/w1-gpio.c b/drivers/w1/masters/w1-gpio.c
> index 9e1138a..a411702 100644
> --- a/drivers/w1/masters/w1-gpio.c
> +++ b/drivers/w1/masters/w1-gpio.c
> @@ -39,7 +39,7 @@ static u8 w1_gpio_read_bit(void *data)
>  {
>  	struct w1_gpio_platform_data *pdata = data;
>  
> -	return gpio_get_value(pdata->pin);
> +	return gpio_get_value(pdata->pin) ? 1 : 0;
>  }
>  
>  static int __init w1_gpio_probe(struct platform_device *pdev)

We recently merged a patch (I forget where) which fixed one
gpio_get_value() implementation so that it always returns 0 or 1.

>From which I deduce that the correct fix for <whatever problem you're
seeing> is to fix <whichever driver that is>?

  reply	other threads:[~2009-03-10  2:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-09 16:02 [PATCH] drivers/w1/masters/w1-gpio.c: fix read_bit() Daniel Mack
2009-03-10  2:14 ` Andrew Morton [this message]
2009-03-10  9:18   ` Daniel Mack
2009-03-10 22:00     ` Andrew Morton
2009-03-10 23:59       ` Ville Syrjälä
2009-03-11  0:10       ` Daniel Mack
2009-03-11  1:17         ` Andrew Morton
2009-03-10 14:13   ` Ville Syrjälä

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=20090309191419.98699220.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=daniel@caiaq.de \
    --cc=david-b@pacbell.net \
    --cc=johnpol@2ka.mipt.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syrjala@sci.fi \
    /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