gpio fixes for v6.18-rc5

- use the firmware node of the GPIO chip, not its label for software
   node lookup
 - fix invalid pointer access in GPIO debugfs
 - drop unused functions from gpio-tb10x
 - fix a regression in gpio-aggregator: restore the set_config() callback
   in the driver
 - correct schema $id path in ti,twl4030 DT bindings
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmkOBdIACgkQEacuoBRx
 13LniBAAh6Y8qsyLj7Iq3TiNL9YBSO7SEDDuKGHCOGfVIm00dubJvFk2BI6UHDb2
 fb/K1rl42CRGxiqChCpqjqh54BXNskgPxUVB+uE+S5Gh4AVit27/IjIcH7z8UiJm
 38x3HPO/30Q4NCQ3PvJHwa7bHvDvnwssTkUZw32EHpRNF6xC4nFX4J99YQSmZtc2
 Lsg7qlsFQa3o1bp0jJuZz+NbdLb1oH2PhuR2rlT2yweLblYhJ159Vexpsfpw9D82
 aW7b5gK3VEGlhfXhR4apE5mo5DasB7Tpcr2kMmijZJBKAjZFnAWBHJBxEJOZfVPP
 6nsSen6bEtpDfMyu667oCmwULJulHdi0iK7n72wcX2rQzmcr4q5A0ub2lSgOmaAD
 LEqQNDUcTm17O1NXztyWpbaysG7IchlIZ3+c7YkWZOQWB/FJBJuGOCUoNUBUcwTB
 e68YiBbq8fau9hN9c03d3cuQcxzqO3iydMEFay/bq1+WaTDi0qFaX/1OZW2sxgG0
 r04cX1TdYIEjDoMdwJM60uGcwWrcKap3C6Kih8cMGkaG3AFsdILS3+E4fzonsIaE
 XsZOPmlY5pb399nEo0uAkLeUeYhdbPqSJ6WjnUSRegpB9iOHwA9Cml0lUf40NeRm
 ouoL8fJaFkD1rsUmmdo5a4YataYnlCuML+WWrFhuO37s79U3OGg=
 =4JGk
 -----END PGP SIGNATURE-----

Merge tag 'gpio-fixes-for-v6.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio fixes from Bartosz Golaszewski:

 - use the firmware node of the GPIO chip, not its label for software
   node lookup

 - fix invalid pointer access in GPIO debugfs

 - drop unused functions from gpio-tb10x

 - fix a regression in gpio-aggregator: restore the set_config()
   callback in the driver

 - correct schema $id path in ti,twl4030 DT bindings

* tag 'gpio-fixes-for-v6.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
  gpio: tb10x: Drop unused tb10x_set_bits() function
  gpio: aggregator: restore the set_config operation
  gpiolib: fix invalid pointer access in debugfs
  gpio: swnode: don't use the swnode's name as the key for GPIO lookup
  dt-bindings: gpio: ti,twl4030: Correct the schema $id path
This commit is contained in:
Linus Torvalds 2025-11-07 08:10:55 -08:00
commit da32d155f4
5 changed files with 10 additions and 22 deletions

View File

@ -1,7 +1,7 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/ti,twl4030-gpio.yaml#
$id: http://devicetree.org/schemas/gpio/ti,twl4030-gpio.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: TI TWL4030 GPIO controller

View File

@ -723,6 +723,7 @@ struct gpiochip_fwd *devm_gpiochip_fwd_alloc(struct device *dev,
chip->get_multiple = gpio_fwd_get_multiple_locked;
chip->set = gpio_fwd_set;
chip->set_multiple = gpio_fwd_set_multiple_locked;
chip->set_config = gpio_fwd_set_config;
chip->to_irq = gpio_fwd_to_irq;
chip->base = -1;
chip->ngpio = ngpios;

View File

@ -50,25 +50,6 @@ static inline u32 tb10x_reg_read(struct tb10x_gpio *gpio, unsigned int offs)
return ioread32(gpio->base + offs);
}
static inline void tb10x_reg_write(struct tb10x_gpio *gpio, unsigned int offs,
u32 val)
{
iowrite32(val, gpio->base + offs);
}
static inline void tb10x_set_bits(struct tb10x_gpio *gpio, unsigned int offs,
u32 mask, u32 val)
{
u32 r;
guard(gpio_generic_lock_irqsave)(&gpio->chip);
r = tb10x_reg_read(gpio, offs);
r = (r & ~mask) | (val & mask);
tb10x_reg_write(gpio, offs, r);
}
static int tb10x_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
{
struct tb10x_gpio *tb10x_gpio = gpiochip_get_data(chip);

View File

@ -41,7 +41,7 @@ static struct gpio_device *swnode_get_gpio_device(struct fwnode_handle *fwnode)
!strcmp(gdev_node->name, GPIOLIB_SWNODE_UNDEFINED_NAME))
return ERR_PTR(-ENOENT);
gdev = gpio_device_find_by_label(gdev_node->name);
gdev = gpio_device_find_by_fwnode(fwnode);
return gdev ?: ERR_PTR(-EPROBE_DEFER);
}

View File

@ -5296,6 +5296,8 @@ static void *gpiolib_seq_start(struct seq_file *s, loff_t *pos)
struct gpio_device *gdev;
loff_t index = *pos;
s->private = NULL;
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (!priv)
return NULL;
@ -5329,7 +5331,11 @@ static void *gpiolib_seq_next(struct seq_file *s, void *v, loff_t *pos)
static void gpiolib_seq_stop(struct seq_file *s, void *v)
{
struct gpiolib_seq_priv *priv = s->private;
struct gpiolib_seq_priv *priv;
priv = s->private;
if (!priv)
return;
srcu_read_unlock(&gpio_devices_srcu, priv->idx);
kfree(priv);