Skip to content

Commit

Permalink
drivers/w1/masters/w1-gpio.c: fix read_bit()
Browse files Browse the repository at this point in the history
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>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Daniel Mack authored and Linus Torvalds committed Mar 12, 2009
1 parent 00699e8 commit 8d0df7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/w1/masters/w1-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8d0df7a

Please sign in to comment.