Commit 86d07565 authored by Linus Walleij's avatar Linus Walleij
Browse files

Merge tag 'gpio-v5.1-rc3-fixes-for-linus' of...

Merge tag 'gpio-v5.1-rc3-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into fixes

gpio fixes for v5.1-rc3

- fix for a potential NULL-pointer dereference in the aspeed driver
- revert of the commit using the new gpio_set_config() when setting
  debaunce and transitory state config as it caused a regression in
  the aspeed driver
- two fixes for gpio-mockup for debugfs problems introduced in the
  last merge window
parents f7299d44 ce9fb53c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1224,6 +1224,8 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev)

	gpio->offset_timer =
		devm_kzalloc(&pdev->dev, gpio->chip.ngpio, GFP_KERNEL);
	if (!gpio->offset_timer)
		return -ENOMEM;

	return aspeed_gpio_setup_irqs(gpio, pdev);
}
+3 −7
Original line number Diff line number Diff line
@@ -204,8 +204,8 @@ static ssize_t gpio_mockup_debugfs_read(struct file *file,
	struct gpio_mockup_chip *chip;
	struct seq_file *sfile;
	struct gpio_chip *gc;
	int val, cnt;
	char buf[3];
	int val, rv;

	if (*ppos != 0)
		return 0;
@@ -216,13 +216,9 @@ static ssize_t gpio_mockup_debugfs_read(struct file *file,
	gc = &chip->gc;

	val = gpio_mockup_get(gc, priv->offset);
	snprintf(buf, sizeof(buf), "%d\n", val);
	cnt = snprintf(buf, sizeof(buf), "%d\n", val);

	rv = copy_to_user(usr_buf, buf, sizeof(buf));
	if (rv)
		return rv;

	return sizeof(buf) - 1;
	return simple_read_from_buffer(usr_buf, size, ppos, buf, cnt);
}

static ssize_t gpio_mockup_debugfs_write(struct file *file,
+2 −2
Original line number Diff line number Diff line
@@ -2776,7 +2776,7 @@ int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce)
	}

	config = pinconf_to_config_packed(PIN_CONFIG_INPUT_DEBOUNCE, debounce);
	return gpio_set_config(chip, gpio_chip_hwgpio(desc), config);
	return chip->set_config(chip, gpio_chip_hwgpio(desc), config);
}
EXPORT_SYMBOL_GPL(gpiod_set_debounce);

@@ -2813,7 +2813,7 @@ int gpiod_set_transitory(struct gpio_desc *desc, bool transitory)
	packed = pinconf_to_config_packed(PIN_CONFIG_PERSIST_STATE,
					  !transitory);
	gpio = gpio_chip_hwgpio(desc);
	rc = gpio_set_config(chip, gpio, packed);
	rc = chip->set_config(chip, gpio, packed);
	if (rc == -ENOTSUPP) {
		dev_dbg(&desc->gdev->dev, "Persistence not supported for GPIO %d\n",
				gpio);