Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'v5.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull GPIO fixes from Linus Walleij:
"These are hopefully the last GPIO fixes for this cycle.

All are driver fixes except a small resource leak for pin ranges in
the gpiolib. Two are PM related, which is nice because when developers
start to find PM bugs it is usually because they have smoked out the
bugs of more severe nature.

Summary:

- Fix runtime PM balancing on the errorpath of the Arizona driver

- Fix a suspend NULL pointer reference in the dwapb driver

- Balance free:ing in gpiochip_generic_free()

- Fix runtime PM balancing on the errorpath of the zynq driver

- Fix irqdomain use-after-free in the mvebu driver

- Break an eternal loop in the spreadtrum EIC driver"

* tag 'v5.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
gpio: eic-sprd: break loop when getting NULL device resource
gpio: mvebu: fix potential user-after-free on probe
gpio: zynq: fix reference leak in zynq_gpio functions
gpiolib: Don't free if pin ranges are not defined
gpio: dwapb: fix NULL pointer dereference at dwapb_gpio_suspend()
gpio: arizona: disable pm_runtime in case of failure

+22 -8
+1
drivers/gpio/gpio-arizona.c
··· 192 192 ret = devm_gpiochip_add_data(&pdev->dev, &arizona_gpio->gpio_chip, 193 193 arizona_gpio); 194 194 if (ret < 0) { 195 + pm_runtime_disable(&pdev->dev); 195 196 dev_err(&pdev->dev, "Could not register gpiochip, %d\n", 196 197 ret); 197 198 return ret;
+2
drivers/gpio/gpio-dwapb.c
··· 724 724 return err; 725 725 } 726 726 727 + platform_set_drvdata(pdev, gpio); 728 + 727 729 return 0; 728 730 } 729 731
+1 -1
drivers/gpio/gpio-eic-sprd.c
··· 598 598 */ 599 599 res = platform_get_resource(pdev, IORESOURCE_MEM, i); 600 600 if (!res) 601 - continue; 601 + break; 602 602 603 603 sprd_eic->base[i] = devm_ioremap_resource(&pdev->dev, res); 604 604 if (IS_ERR(sprd_eic->base[i]))
+11 -5
drivers/gpio/gpio-mvebu.c
··· 1197 1197 1198 1198 devm_gpiochip_add_data(&pdev->dev, &mvchip->chip, mvchip); 1199 1199 1200 + /* Some MVEBU SoCs have simple PWM support for GPIO lines */ 1201 + if (IS_ENABLED(CONFIG_PWM)) { 1202 + err = mvebu_pwm_probe(pdev, mvchip, id); 1203 + if (err) 1204 + return err; 1205 + } 1206 + 1200 1207 /* Some gpio controllers do not provide irq support */ 1201 1208 if (!have_irqs) 1202 1209 return 0; ··· 1213 1206 if (!mvchip->domain) { 1214 1207 dev_err(&pdev->dev, "couldn't allocate irq domain %s (DT).\n", 1215 1208 mvchip->chip.label); 1216 - return -ENODEV; 1209 + err = -ENODEV; 1210 + goto err_pwm; 1217 1211 } 1218 1212 1219 1213 err = irq_alloc_domain_generic_chips( ··· 1262 1254 mvchip); 1263 1255 } 1264 1256 1265 - /* Some MVEBU SoCs have simple PWM support for GPIO lines */ 1266 - if (IS_ENABLED(CONFIG_PWM)) 1267 - return mvebu_pwm_probe(pdev, mvchip, id); 1268 - 1269 1257 return 0; 1270 1258 1271 1259 err_domain: 1272 1260 irq_domain_remove(mvchip->domain); 1261 + err_pwm: 1262 + pwmchip_remove(&mvchip->mvpwm->chip); 1273 1263 1274 1264 return err; 1275 1265 }
+2 -2
drivers/gpio/gpio-zynq.c
··· 574 574 struct gpio_chip *chip = irq_data_get_irq_chip_data(d); 575 575 int ret; 576 576 577 - ret = pm_runtime_get_sync(chip->parent); 577 + ret = pm_runtime_resume_and_get(chip->parent); 578 578 if (ret < 0) 579 579 return ret; 580 580 ··· 942 942 943 943 pm_runtime_set_active(&pdev->dev); 944 944 pm_runtime_enable(&pdev->dev); 945 - ret = pm_runtime_get_sync(&pdev->dev); 945 + ret = pm_runtime_resume_and_get(&pdev->dev); 946 946 if (ret < 0) 947 947 goto err_pm_dis; 948 948
+5
drivers/gpio/gpiolib.c
··· 1806 1806 */ 1807 1807 void gpiochip_generic_free(struct gpio_chip *gc, unsigned offset) 1808 1808 { 1809 + #ifdef CONFIG_PINCTRL 1810 + if (list_empty(&gc->gpiodev->pin_ranges)) 1811 + return; 1812 + #endif 1813 + 1809 1814 pinctrl_gpio_free(gc->gpiodev->base + offset); 1810 1815 } 1811 1816 EXPORT_SYMBOL_GPL(gpiochip_generic_free);