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 'gpio-fixes-for-v6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio fixes from Bartosz Golaszewski:

- fix initial value handling for output-only pins in gpio-tps68470

- fix two resource leaks in gpio-mvebu

* tag 'gpio-fixes-for-v6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
gpio: mvebu: fix irq domain leak
gpio: mvebu: Make use of devm_pwmchip_add
gpio: tps68470: Make tps68470_gpio_output() always set the initial value

+18 -14
+15 -11
drivers/gpio/gpio-mvebu.c
··· 874 874 875 875 spin_lock_init(&mvpwm->lock); 876 876 877 - return pwmchip_add(&mvpwm->chip); 877 + return devm_pwmchip_add(dev, &mvpwm->chip); 878 878 } 879 879 880 880 #ifdef CONFIG_DEBUG_FS ··· 1112 1112 return 0; 1113 1113 } 1114 1114 1115 + static void mvebu_gpio_remove_irq_domain(void *data) 1116 + { 1117 + struct irq_domain *domain = data; 1118 + 1119 + irq_domain_remove(domain); 1120 + } 1121 + 1115 1122 static int mvebu_gpio_probe(struct platform_device *pdev) 1116 1123 { 1117 1124 struct mvebu_gpio_chip *mvchip; ··· 1250 1243 if (!mvchip->domain) { 1251 1244 dev_err(&pdev->dev, "couldn't allocate irq domain %s (DT).\n", 1252 1245 mvchip->chip.label); 1253 - err = -ENODEV; 1254 - goto err_pwm; 1246 + return -ENODEV; 1255 1247 } 1248 + 1249 + err = devm_add_action_or_reset(&pdev->dev, mvebu_gpio_remove_irq_domain, 1250 + mvchip->domain); 1251 + if (err) 1252 + return err; 1256 1253 1257 1254 err = irq_alloc_domain_generic_chips( 1258 1255 mvchip->domain, ngpios, 2, np->name, handle_level_irq, ··· 1264 1253 if (err) { 1265 1254 dev_err(&pdev->dev, "couldn't allocate irq chips %s (DT).\n", 1266 1255 mvchip->chip.label); 1267 - goto err_domain; 1256 + return err; 1268 1257 } 1269 1258 1270 1259 /* ··· 1304 1293 } 1305 1294 1306 1295 return 0; 1307 - 1308 - err_domain: 1309 - irq_domain_remove(mvchip->domain); 1310 - err_pwm: 1311 - pwmchip_remove(&mvchip->mvpwm->chip); 1312 - 1313 - return err; 1314 1296 } 1315 1297 1316 1298 static struct platform_driver mvebu_gpio_driver = {
+3 -3
drivers/gpio/gpio-tps68470.c
··· 91 91 struct tps68470_gpio_data *tps68470_gpio = gpiochip_get_data(gc); 92 92 struct regmap *regmap = tps68470_gpio->tps68470_regmap; 93 93 94 + /* Set the initial value */ 95 + tps68470_gpio_set(gc, offset, value); 96 + 94 97 /* rest are always outputs */ 95 98 if (offset >= TPS68470_N_REGULAR_GPIO) 96 99 return 0; 97 - 98 - /* Set the initial value */ 99 - tps68470_gpio_set(gc, offset, value); 100 100 101 101 return regmap_update_bits(regmap, TPS68470_GPIO_CTL_REG_A(offset), 102 102 TPS68470_GPIO_MODE_MASK,