Re: [PATCH] gpio: sx150x: fix error code value

From: Gregory Bean
Date: Mon Sep 13 2010 - 12:23:10 EST


err = sx150x_i2c_read(chip->client, reg,&data);
if (err>= 0)
- err = (data& mask) != 0 ? 1 : 0;
+ err = (data& mask) != 0 ? -EIO : 0;


This doesn't work. The IO pins are gpio data pins, which are used as 0 or 1 data values (see sx150x_gpio_get). Returning -EIO whenever an attempt is made to gpio_get_value on a non-zero gpio line will break things.

--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/