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 'pinctrl-v6.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pin control fixes from Linus Walleij:
"Mostly error path fixes, but one pretty serious interrupt problem in
the Ocelot driver as well:

- Fix two error paths and a missing semicolon in the Intel driver

- Add a missing ACPI ID for the Intel Panther Lake

- Check return value of devm_kasprintf() in the Apple and STM32
drivers

- Add a missing mutex_destroy() in the aw9523 driver

- Fix a double free in cv1800_pctrl_dt_node_to_map() in the Sophgo
driver

- Fix a double free in ma35_pinctrl_dt_node_to_map_func() in the
Nuvoton driver

- Fix a bug in the Ocelot interrupt handler making the system hang"

* tag 'pinctrl-v6.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
pinctrl: ocelot: fix system hang on level based interrupts
pinctrl: nuvoton: fix a double free in ma35_pinctrl_dt_node_to_map_func()
pinctrl: sophgo: fix double free in cv1800_pctrl_dt_node_to_map()
pinctrl: intel: platform: Add Panther Lake to the list of supported
pinctrl: aw9523: add missing mutex_destroy
pinctrl: stm32: check devm_kasprintf() returned value
pinctrl: apple: check devm_kasprintf() returned value
pinctrl: intel: platform: use semicolon instead of comma in ncommunities assignment
pinctrl: intel: platform: fix error path in device_for_each_child_node()

+23 -13
+1
drivers/pinctrl/intel/Kconfig
··· 46 46 of Intel PCH pins and using them as GPIOs. Currently the following 47 47 Intel SoCs / platforms require this to be functional: 48 48 - Lunar Lake 49 + - Panther Lake 49 50 50 51 config PINCTRL_ALDERLAKE 51 52 tristate "Intel Alder Lake pinctrl and GPIO driver"
+2 -3
drivers/pinctrl/intel/pinctrl-intel-platform.c
··· 90 90 struct intel_community *community, 91 91 struct intel_platform_pins *pins) 92 92 { 93 - struct fwnode_handle *child; 94 93 struct intel_padgroup *gpps; 95 94 unsigned int group; 96 95 size_t ngpps; ··· 130 131 return -ENOMEM; 131 132 132 133 group = 0; 133 - device_for_each_child_node(dev, child) { 134 + device_for_each_child_node_scoped(dev, child) { 134 135 struct intel_padgroup *gpp = &gpps[group]; 135 136 136 137 gpp->reg_num = group; ··· 158 159 int ret; 159 160 160 161 /* Version 1.0 of the specification assumes only a single community per device node */ 161 - ncommunities = 1, 162 + ncommunities = 1; 162 163 communities = devm_kcalloc(dev, ncommunities, sizeof(*communities), GFP_KERNEL); 163 164 if (!communities) 164 165 return -ENOMEM;
+1 -1
drivers/pinctrl/nuvoton/pinctrl-ma35.c
··· 218 218 } 219 219 220 220 map_num += grp->npins; 221 - new_map = devm_kcalloc(pctldev->dev, map_num, sizeof(*new_map), GFP_KERNEL); 221 + new_map = kcalloc(map_num, sizeof(*new_map), GFP_KERNEL); 222 222 if (!new_map) 223 223 return -ENOMEM; 224 224
+3
drivers/pinctrl/pinctrl-apple-gpio.c
··· 474 474 for (i = 0; i < npins; i++) { 475 475 pins[i].number = i; 476 476 pins[i].name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "PIN%u", i); 477 + if (!pins[i].name) 478 + return -ENOMEM; 479 + 477 480 pins[i].drv_data = pctl; 478 481 pin_names[i] = pins[i].name; 479 482 pin_nums[i] = i;
+4 -2
drivers/pinctrl/pinctrl-aw9523.c
··· 987 987 lockdep_set_subclass(&awi->i2c_lock, i2c_adapter_depth(client->adapter)); 988 988 989 989 pdesc = devm_kzalloc(dev, sizeof(*pdesc), GFP_KERNEL); 990 - if (!pdesc) 991 - return -ENOMEM; 990 + if (!pdesc) { 991 + ret = -ENOMEM; 992 + goto err_disable_vregs; 993 + } 992 994 993 995 ret = aw9523_hw_init(awi); 994 996 if (ret)
+4 -4
drivers/pinctrl/pinctrl-ocelot.c
··· 1955 1955 unsigned int reg = 0, irq, i; 1956 1956 unsigned long irqs; 1957 1957 1958 + chained_irq_enter(parent_chip, desc); 1959 + 1958 1960 for (i = 0; i < info->stride; i++) { 1959 1961 regmap_read(info->map, id_reg + 4 * i, &reg); 1960 1962 if (!reg) 1961 1963 continue; 1962 - 1963 - chained_irq_enter(parent_chip, desc); 1964 1964 1965 1965 irqs = reg; 1966 1966 1967 1967 for_each_set_bit(irq, &irqs, 1968 1968 min(32U, info->desc->npins - 32 * i)) 1969 1969 generic_handle_domain_irq(chip->irq.domain, irq + 32 * i); 1970 - 1971 - chained_irq_exit(parent_chip, desc); 1972 1970 } 1971 + 1972 + chained_irq_exit(parent_chip, desc); 1973 1973 } 1974 1974 1975 1975 static int ocelot_gpiochip_register(struct platform_device *pdev,
+1 -1
drivers/pinctrl/sophgo/pinctrl-cv18xx.c
··· 221 221 if (!grpnames) 222 222 return -ENOMEM; 223 223 224 - map = devm_kcalloc(dev, ngroups * 2, sizeof(*map), GFP_KERNEL); 224 + map = kcalloc(ngroups * 2, sizeof(*map), GFP_KERNEL); 225 225 if (!map) 226 226 return -ENOMEM; 227 227
+7 -2
drivers/pinctrl/stm32/pinctrl-stm32.c
··· 1374 1374 1375 1375 for (i = 0; i < npins; i++) { 1376 1376 stm32_pin = stm32_pctrl_get_desc_pin_from_gpio(pctl, bank, i); 1377 - if (stm32_pin && stm32_pin->pin.name) 1377 + if (stm32_pin && stm32_pin->pin.name) { 1378 1378 names[i] = devm_kasprintf(dev, GFP_KERNEL, "%s", stm32_pin->pin.name); 1379 - else 1379 + if (!names[i]) { 1380 + err = -ENOMEM; 1381 + goto err_clk; 1382 + } 1383 + } else { 1380 1384 names[i] = NULL; 1385 + } 1381 1386 } 1382 1387 1383 1388 bank->gpio_chip.names = (const char * const *)names;