Commit bc7bc688 authored by Kent Gibson's avatar Kent Gibson Committed by Bartosz Golaszewski
Browse files

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: e42615ec ("gpio: Use new GPIO_LINE_DIRECTION")
Signed-off-by: default avatarKent Gibson <warthog618@gmail.com>
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
parent 634f0348
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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)