Skip to content

Commit da32d15

Browse files
committed
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
2 parents 5b95a50 + 4436f48 commit da32d15

5 files changed

Lines changed: 10 additions & 22 deletions

File tree

Documentation/devicetree/bindings/gpio/ti,twl4030-gpio.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
22
%YAML 1.2
33
---
4-
$id: http://devicetree.org/schemas/ti,twl4030-gpio.yaml#
4+
$id: http://devicetree.org/schemas/gpio/ti,twl4030-gpio.yaml#
55
$schema: http://devicetree.org/meta-schemas/core.yaml#
66

77
title: TI TWL4030 GPIO controller

drivers/gpio/gpio-aggregator.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,7 @@ struct gpiochip_fwd *devm_gpiochip_fwd_alloc(struct device *dev,
723723
chip->get_multiple = gpio_fwd_get_multiple_locked;
724724
chip->set = gpio_fwd_set;
725725
chip->set_multiple = gpio_fwd_set_multiple_locked;
726+
chip->set_config = gpio_fwd_set_config;
726727
chip->to_irq = gpio_fwd_to_irq;
727728
chip->base = -1;
728729
chip->ngpio = ngpios;

drivers/gpio/gpio-tb10x.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,25 +50,6 @@ static inline u32 tb10x_reg_read(struct tb10x_gpio *gpio, unsigned int offs)
5050
return ioread32(gpio->base + offs);
5151
}
5252

53-
static inline void tb10x_reg_write(struct tb10x_gpio *gpio, unsigned int offs,
54-
u32 val)
55-
{
56-
iowrite32(val, gpio->base + offs);
57-
}
58-
59-
static inline void tb10x_set_bits(struct tb10x_gpio *gpio, unsigned int offs,
60-
u32 mask, u32 val)
61-
{
62-
u32 r;
63-
64-
guard(gpio_generic_lock_irqsave)(&gpio->chip);
65-
66-
r = tb10x_reg_read(gpio, offs);
67-
r = (r & ~mask) | (val & mask);
68-
69-
tb10x_reg_write(gpio, offs, r);
70-
}
71-
7253
static int tb10x_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
7354
{
7455
struct tb10x_gpio *tb10x_gpio = gpiochip_get_data(chip);

drivers/gpio/gpiolib-swnode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static struct gpio_device *swnode_get_gpio_device(struct fwnode_handle *fwnode)
4141
!strcmp(gdev_node->name, GPIOLIB_SWNODE_UNDEFINED_NAME))
4242
return ERR_PTR(-ENOENT);
4343

44-
gdev = gpio_device_find_by_label(gdev_node->name);
44+
gdev = gpio_device_find_by_fwnode(fwnode);
4545
return gdev ?: ERR_PTR(-EPROBE_DEFER);
4646
}
4747

drivers/gpio/gpiolib.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5296,6 +5296,8 @@ static void *gpiolib_seq_start(struct seq_file *s, loff_t *pos)
52965296
struct gpio_device *gdev;
52975297
loff_t index = *pos;
52985298

5299+
s->private = NULL;
5300+
52995301
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
53005302
if (!priv)
53015303
return NULL;
@@ -5329,7 +5331,11 @@ static void *gpiolib_seq_next(struct seq_file *s, void *v, loff_t *pos)
53295331

53305332
static void gpiolib_seq_stop(struct seq_file *s, void *v)
53315333
{
5332-
struct gpiolib_seq_priv *priv = s->private;
5334+
struct gpiolib_seq_priv *priv;
5335+
5336+
priv = s->private;
5337+
if (!priv)
5338+
return;
53335339

53345340
srcu_read_unlock(&gpio_devices_srcu, priv->idx);
53355341
kfree(priv);

0 commit comments

Comments
 (0)