Skip to content

Commit 30c8e80

Browse files
committed
Merge tag 'gpio-fixes-for-v5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux
Pull gpio fixes from Bartosz Golaszewski: - fix the bounds check for the 'gpio-reserved-ranges' device property in gpiolib-of - drop the assignment of the pwm base number in gpio-mvebu (this was missed by the patch doing it globally for all pwm drivers) - fix the fwnode assignment (use own fwnode, not the parent's one) for the GPIO irqchip in gpio-visconti - update the irq_stat field before checking the trigger field in gpio-pca953x - update GPIO entry in MAINTAINERS * tag 'gpio-fixes-for-v5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: pca953x: fix irq_stat not updated when irq is disabled (irq_mask not set) gpio: visconti: Fix fwnode of GPIO IRQ MAINTAINERS: update the GPIO git tree entry gpio: mvebu: drop pwm base assignment gpiolib: of: fix bounds check for 'gpio-reserved-ranges'
2 parents 8967605 + dba7857 commit 30c8e80

5 files changed

Lines changed: 6 additions & 16 deletions

File tree

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8385,7 +8385,7 @@ M: Linus Walleij <linus.walleij@linaro.org>
83858385
M: Bartosz Golaszewski <brgl@bgdev.pl>
83868386
L: linux-gpio@vger.kernel.org
83878387
S: Maintained
8388-
T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git
8388+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git
83898389
F: Documentation/ABI/obsolete/sysfs-gpio
83908390
F: Documentation/ABI/testing/gpio-cdev
83918391
F: Documentation/admin-guide/gpio/

drivers/gpio/gpio-mvebu.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -871,13 +871,6 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
871871
mvpwm->chip.dev = dev;
872872
mvpwm->chip.ops = &mvebu_pwm_ops;
873873
mvpwm->chip.npwm = mvchip->chip.ngpio;
874-
/*
875-
* There may already be some PWM allocated, so we can't force
876-
* mvpwm->chip.base to a fixed point like mvchip->chip.base.
877-
* So, we let pwmchip_add() do the numbering and take the next free
878-
* region.
879-
*/
880-
mvpwm->chip.base = -1;
881874

882875
spin_lock_init(&mvpwm->lock);
883876

drivers/gpio/gpio-pca953x.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,11 +762,11 @@ static bool pca953x_irq_pending(struct pca953x_chip *chip, unsigned long *pendin
762762
bitmap_xor(cur_stat, new_stat, old_stat, gc->ngpio);
763763
bitmap_and(trigger, cur_stat, chip->irq_mask, gc->ngpio);
764764

765+
bitmap_copy(chip->irq_stat, new_stat, gc->ngpio);
766+
765767
if (bitmap_empty(trigger, gc->ngpio))
766768
return false;
767769

768-
bitmap_copy(chip->irq_stat, new_stat, gc->ngpio);
769-
770770
bitmap_and(cur_stat, chip->irq_trig_fall, old_stat, gc->ngpio);
771771
bitmap_and(old_stat, chip->irq_trig_raise, new_stat, gc->ngpio);
772772
bitmap_or(new_stat, old_stat, cur_stat, gc->ngpio);

drivers/gpio/gpio-visconti.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ static int visconti_gpio_probe(struct platform_device *pdev)
130130
struct gpio_irq_chip *girq;
131131
struct irq_domain *parent;
132132
struct device_node *irq_parent;
133-
struct fwnode_handle *fwnode;
134133
int ret;
135134

136135
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
@@ -150,14 +149,12 @@ static int visconti_gpio_probe(struct platform_device *pdev)
150149
}
151150

152151
parent = irq_find_host(irq_parent);
152+
of_node_put(irq_parent);
153153
if (!parent) {
154154
dev_err(dev, "No IRQ parent domain\n");
155155
return -ENODEV;
156156
}
157157

158-
fwnode = of_node_to_fwnode(irq_parent);
159-
of_node_put(irq_parent);
160-
161158
ret = bgpio_init(&priv->gpio_chip, dev, 4,
162159
priv->base + GPIO_IDATA,
163160
priv->base + GPIO_OSET,
@@ -180,7 +177,7 @@ static int visconti_gpio_probe(struct platform_device *pdev)
180177

181178
girq = &priv->gpio_chip.irq;
182179
girq->chip = irq_chip;
183-
girq->fwnode = fwnode;
180+
girq->fwnode = of_node_to_fwnode(dev->of_node);
184181
girq->parent_domain = parent;
185182
girq->child_to_parent_hwirq = visconti_gpio_child_to_parent_hwirq;
186183
girq->populate_parent_alloc_arg = visconti_gpio_populate_parent_fwspec;

drivers/gpio/gpiolib-of.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ static void of_gpiochip_init_valid_mask(struct gpio_chip *chip)
910910
i, &start);
911911
of_property_read_u32_index(np, "gpio-reserved-ranges",
912912
i + 1, &count);
913-
if (start >= chip->ngpio || start + count >= chip->ngpio)
913+
if (start >= chip->ngpio || start + count > chip->ngpio)
914914
continue;
915915

916916
bitmap_clear(chip->valid_mask, start, count);

0 commit comments

Comments
 (0)