diff options
author | Daniel Mack <daniel@caiaq.de> | 2009-03-12 17:31:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-12 19:20:23 -0400 |
commit | 8d0df7a3d1ecbaf5d5602a59055c8ca993855bed (patch) | |
tree | a9d9834c949da6e6572cc5d897560d2ded1adcfe | |
parent | 00699e8472cc0209d57b5c5614bc2ec98e665004 (diff) |
drivers/w1/masters/w1-gpio.c: fix read_bit()
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>
-rw-r--r-- | 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 9e1138a75e8b..a411702413d6 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) | |||
39 | { | 39 | { |
40 | struct w1_gpio_platform_data *pdata = data; | 40 | struct w1_gpio_platform_data *pdata = data; |
41 | 41 | ||
42 | return gpio_get_value(pdata->pin); | 42 | return gpio_get_value(pdata->pin) ? 1 : 0; |
43 | } | 43 | } |
44 | 44 | ||
45 | static int __init w1_gpio_probe(struct platform_device *pdev) | 45 | static int __init w1_gpio_probe(struct platform_device *pdev) |