1
0
Fork 0

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
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAlyc/4oACgkQEacuoBRx
 13LP1BAAsVF0CEhgAK+gFbT//VVtiYJi/O2gGyZfwI/ClMzztbeACdbZQwa9ssB6
 RZ+y8IuPJ1uC3hQS64I9aRJe7qdpj39aaK29+1DOSUpa6ms/KoM7wuvwK+WaslGs
 0zm/Y7bxd5l6Cl+z6K4BSz0F+GFijTc6bzJEAokO4eMXfYZmj2Yzx++iAoCxOrj8
 zwezWMU/9gOTfltpLpe8uLbdouK39MCxR+/iHKwAmmV5AkD5Pfig9DXQLMsMNESm
 Wzen++6rUKFAefasD4A28kE7a0J+kXBRvJMGEZA/tn4gQOfKTE5IP9YlIybUNOfj
 ae1fndlvzgFQl98jt6ZxroQk5LcT9MhOgogJm6fo8PjwKQBKLBrj/2IyzkcSURcZ
 ZQsOhfaA2kOiGTZfowMtbzkuA7SsK+gM+F5m+LJ1UXgStsRZ4POcDopHMVGcSf32
 aMHiCLEgYf0ty4hekPDB9qahEnXXekVLmWvkpO5d9E6j7s4OGJIjVvX1QKEcl7I/
 d/DBa9u2c4W60VFvhxY3RpOjxoohl/KTewSdOG2oRXwOGWnoda6x7c6MYZgGMR2y
 r/LBFBIOs4XoV3z7YAB1povSrqZPTEcoYfI3JtPP2fNXyp06J4IzhXSxv/E4MRQs
 NopB8LWp8V/xbUjJKnXYB+SGp5fWuBUCdhBmugnDlLGHNKt2Rqo=
 =vIKK
 -----END PGP SIGNATURE-----

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
hifive-unleashed-5.1
Linus Walleij 2019-03-29 03:04:47 +01:00
commit 86d0756558
3 changed files with 7 additions and 9 deletions

View File

@ -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);
}

View File

@ -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,

View File

@ -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);