mirror of
https://github.com/torvalds/linux.git
synced 2024-09-20 15:03:04 +00:00
gpio: mockup: Fix usage of new GPIO_LINE_DIRECTION
Restore the external behavior of gpio-mockup to what it was prior to the
change to using GPIO_LINE_DIRECTION.
Fixes: e42615ec23
("gpio: Use new GPIO_LINE_DIRECTION")
Signed-off-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
This commit is contained in:
parent
634f0348fe
commit
bc7bc68836
|
@ -226,7 +226,7 @@ static int gpio_mockup_get_direction(struct gpio_chip *gc, unsigned int offset)
|
|||
int direction;
|
||||
|
||||
mutex_lock(&chip->lock);
|
||||
direction = !chip->lines[offset].dir;
|
||||
direction = chip->lines[offset].dir;
|
||||
mutex_unlock(&chip->lock);
|
||||
|
||||
return direction;
|
||||
|
@ -395,7 +395,7 @@ static int gpio_mockup_probe(struct platform_device *pdev)
|
|||
struct gpio_chip *gc;
|
||||
struct device *dev;
|
||||
const char *name;
|
||||
int rv, base;
|
||||
int rv, base, i;
|
||||
u16 ngpio;
|
||||
|
||||
dev = &pdev->dev;
|
||||
|
@ -447,6 +447,9 @@ static int gpio_mockup_probe(struct platform_device *pdev)
|
|||
if (!chip->lines)
|
||||
return -ENOMEM;
|
||||
|
||||
for (i = 0; i < gc->ngpio; i++)
|
||||
chip->lines[i].dir = GPIO_LINE_DIRECTION_IN;
|
||||
|
||||
if (device_property_read_bool(dev, "named-gpio-lines")) {
|
||||
rv = gpio_mockup_name_lines(dev, chip);
|
||||
if (rv)
|
||||
|
|
Loading…
Reference in New Issue
Block a user