Pin control fixes for the v6.12 kernel series:
- 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.
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAmcVPtQACgkQQRCzN7AZ
XXM67hAAyOKNn3YlRPd/B3hGviWEwV/f2EW2i+g96feM7szPmobvPXcCnPhbXu31
FbpuhodTXw9sz69jDBeBahl4VU/C3+T4/2Fr7xSI8Tu14+nm04OZHvULcch0qpjW
X+y2BPNfM6A4pN8Bxovk9wt31KpkVM11M9jMaQCzNAiWp/vv3qPrdTD51r84yZ5C
GOpKBDyiQF4F5uQsXXPkhmmaQHbiIRDTTPlAGv6R1xlfLtX4RLZUyey3TZnzo3M0
iDfimhqBZmnpE8SPvf6A+cSDCeA1bl3/oKDmh1kaV/hoD9nt7fqfvYW7orBiFykf
1YIvujXu7OOizcRS/hru7aNRSWU3E9E10wR1W1RPfZyY5aRuhNyU3X3cvgEORzLE
QlC2cRXcWOzUJ1pk6IevbOu+3tcPQNvFAo9grSXW/J/LD7pfZjmX9KevKG3esvvJ
p3r4ta8qGP0PCfOU1dHZWWrjzxgotbGp2U1Z9ZxayT/33oEz1FDAnZePb+w7EwwO
0K4PTO4UrN1CLqZYQhyP4ILMnvCuGfBHPdEjmFIySVbJfu/Bqm8IJ45a5AeS0TiE
5S6bkyqS3cGh1k5WKM2kkuCp0gxoL1WFbznR9pmEiZxJ3dyZ7L4BRuk7eIVSN9La
DpDDZqYImeckAG1BNMQolh79mfN0RIBnQr7g/oomCuVe8k/XA+g=
=uwk3
-----END PGP SIGNATURE-----
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()
This commit is contained in:
commit
dd4f50373e
@ -46,6 +46,7 @@ config PINCTRL_INTEL_PLATFORM
|
||||
of Intel PCH pins and using them as GPIOs. Currently the following
|
||||
Intel SoCs / platforms require this to be functional:
|
||||
- Lunar Lake
|
||||
- Panther Lake
|
||||
|
||||
config PINCTRL_ALDERLAKE
|
||||
tristate "Intel Alder Lake pinctrl and GPIO driver"
|
||||
|
||||
@ -90,7 +90,6 @@ static int intel_platform_pinctrl_prepare_community(struct device *dev,
|
||||
struct intel_community *community,
|
||||
struct intel_platform_pins *pins)
|
||||
{
|
||||
struct fwnode_handle *child;
|
||||
struct intel_padgroup *gpps;
|
||||
unsigned int group;
|
||||
size_t ngpps;
|
||||
@ -131,7 +130,7 @@ static int intel_platform_pinctrl_prepare_community(struct device *dev,
|
||||
return -ENOMEM;
|
||||
|
||||
group = 0;
|
||||
device_for_each_child_node(dev, child) {
|
||||
device_for_each_child_node_scoped(dev, child) {
|
||||
struct intel_padgroup *gpp = &gpps[group];
|
||||
|
||||
gpp->reg_num = group;
|
||||
@ -159,7 +158,7 @@ static int intel_platform_pinctrl_prepare_soc_data(struct device *dev,
|
||||
int ret;
|
||||
|
||||
/* Version 1.0 of the specification assumes only a single community per device node */
|
||||
ncommunities = 1,
|
||||
ncommunities = 1;
|
||||
communities = devm_kcalloc(dev, ncommunities, sizeof(*communities), GFP_KERNEL);
|
||||
if (!communities)
|
||||
return -ENOMEM;
|
||||
|
||||
@ -218,7 +218,7 @@ static int ma35_pinctrl_dt_node_to_map_func(struct pinctrl_dev *pctldev,
|
||||
}
|
||||
|
||||
map_num += grp->npins;
|
||||
new_map = devm_kcalloc(pctldev->dev, map_num, sizeof(*new_map), GFP_KERNEL);
|
||||
new_map = kcalloc(map_num, sizeof(*new_map), GFP_KERNEL);
|
||||
if (!new_map)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@ -474,6 +474,9 @@ static int apple_gpio_pinctrl_probe(struct platform_device *pdev)
|
||||
for (i = 0; i < npins; i++) {
|
||||
pins[i].number = i;
|
||||
pins[i].name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "PIN%u", i);
|
||||
if (!pins[i].name)
|
||||
return -ENOMEM;
|
||||
|
||||
pins[i].drv_data = pctl;
|
||||
pin_names[i] = pins[i].name;
|
||||
pin_nums[i] = i;
|
||||
|
||||
@ -987,8 +987,10 @@ static int aw9523_probe(struct i2c_client *client)
|
||||
lockdep_set_subclass(&awi->i2c_lock, i2c_adapter_depth(client->adapter));
|
||||
|
||||
pdesc = devm_kzalloc(dev, sizeof(*pdesc), GFP_KERNEL);
|
||||
if (!pdesc)
|
||||
return -ENOMEM;
|
||||
if (!pdesc) {
|
||||
ret = -ENOMEM;
|
||||
goto err_disable_vregs;
|
||||
}
|
||||
|
||||
ret = aw9523_hw_init(awi);
|
||||
if (ret)
|
||||
|
||||
@ -1955,21 +1955,21 @@ static void ocelot_irq_handler(struct irq_desc *desc)
|
||||
unsigned int reg = 0, irq, i;
|
||||
unsigned long irqs;
|
||||
|
||||
chained_irq_enter(parent_chip, desc);
|
||||
|
||||
for (i = 0; i < info->stride; i++) {
|
||||
regmap_read(info->map, id_reg + 4 * i, ®);
|
||||
if (!reg)
|
||||
continue;
|
||||
|
||||
chained_irq_enter(parent_chip, desc);
|
||||
|
||||
irqs = reg;
|
||||
|
||||
for_each_set_bit(irq, &irqs,
|
||||
min(32U, info->desc->npins - 32 * i))
|
||||
generic_handle_domain_irq(chip->irq.domain, irq + 32 * i);
|
||||
|
||||
chained_irq_exit(parent_chip, desc);
|
||||
}
|
||||
|
||||
chained_irq_exit(parent_chip, desc);
|
||||
}
|
||||
|
||||
static int ocelot_gpiochip_register(struct platform_device *pdev,
|
||||
|
||||
@ -221,7 +221,7 @@ static int cv1800_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
|
||||
if (!grpnames)
|
||||
return -ENOMEM;
|
||||
|
||||
map = devm_kcalloc(dev, ngroups * 2, sizeof(*map), GFP_KERNEL);
|
||||
map = kcalloc(ngroups * 2, sizeof(*map), GFP_KERNEL);
|
||||
if (!map)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@ -1374,10 +1374,15 @@ static int stm32_gpiolib_register_bank(struct stm32_pinctrl *pctl, struct fwnode
|
||||
|
||||
for (i = 0; i < npins; i++) {
|
||||
stm32_pin = stm32_pctrl_get_desc_pin_from_gpio(pctl, bank, i);
|
||||
if (stm32_pin && stm32_pin->pin.name)
|
||||
if (stm32_pin && stm32_pin->pin.name) {
|
||||
names[i] = devm_kasprintf(dev, GFP_KERNEL, "%s", stm32_pin->pin.name);
|
||||
else
|
||||
if (!names[i]) {
|
||||
err = -ENOMEM;
|
||||
goto err_clk;
|
||||
}
|
||||
} else {
|
||||
names[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
bank->gpio_chip.names = (const char * const *)names;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user