Commit 30c8e80f authored by Linus Torvalds's avatar Linus Torvalds

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'
parents 8967605e dba78579
...@@ -8385,7 +8385,7 @@ M: Linus Walleij <linus.walleij@linaro.org> ...@@ -8385,7 +8385,7 @@ M: Linus Walleij <linus.walleij@linaro.org>
M: Bartosz Golaszewski <brgl@bgdev.pl> M: Bartosz Golaszewski <brgl@bgdev.pl>
L: linux-gpio@vger.kernel.org L: linux-gpio@vger.kernel.org
S: Maintained S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git
F: Documentation/ABI/obsolete/sysfs-gpio F: Documentation/ABI/obsolete/sysfs-gpio
F: Documentation/ABI/testing/gpio-cdev F: Documentation/ABI/testing/gpio-cdev
F: Documentation/admin-guide/gpio/ F: Documentation/admin-guide/gpio/
......
...@@ -871,13 +871,6 @@ static int mvebu_pwm_probe(struct platform_device *pdev, ...@@ -871,13 +871,6 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
mvpwm->chip.dev = dev; mvpwm->chip.dev = dev;
mvpwm->chip.ops = &mvebu_pwm_ops; mvpwm->chip.ops = &mvebu_pwm_ops;
mvpwm->chip.npwm = mvchip->chip.ngpio; mvpwm->chip.npwm = mvchip->chip.ngpio;
/*
* There may already be some PWM allocated, so we can't force
* mvpwm->chip.base to a fixed point like mvchip->chip.base.
* So, we let pwmchip_add() do the numbering and take the next free
* region.
*/
mvpwm->chip.base = -1;
spin_lock_init(&mvpwm->lock); spin_lock_init(&mvpwm->lock);
......
...@@ -762,11 +762,11 @@ static bool pca953x_irq_pending(struct pca953x_chip *chip, unsigned long *pendin ...@@ -762,11 +762,11 @@ static bool pca953x_irq_pending(struct pca953x_chip *chip, unsigned long *pendin
bitmap_xor(cur_stat, new_stat, old_stat, gc->ngpio); bitmap_xor(cur_stat, new_stat, old_stat, gc->ngpio);
bitmap_and(trigger, cur_stat, chip->irq_mask, gc->ngpio); bitmap_and(trigger, cur_stat, chip->irq_mask, gc->ngpio);
bitmap_copy(chip->irq_stat, new_stat, gc->ngpio);
if (bitmap_empty(trigger, gc->ngpio)) if (bitmap_empty(trigger, gc->ngpio))
return false; return false;
bitmap_copy(chip->irq_stat, new_stat, gc->ngpio);
bitmap_and(cur_stat, chip->irq_trig_fall, old_stat, gc->ngpio); bitmap_and(cur_stat, chip->irq_trig_fall, old_stat, gc->ngpio);
bitmap_and(old_stat, chip->irq_trig_raise, new_stat, gc->ngpio); bitmap_and(old_stat, chip->irq_trig_raise, new_stat, gc->ngpio);
bitmap_or(new_stat, old_stat, cur_stat, gc->ngpio); bitmap_or(new_stat, old_stat, cur_stat, gc->ngpio);
......
...@@ -130,7 +130,6 @@ static int visconti_gpio_probe(struct platform_device *pdev) ...@@ -130,7 +130,6 @@ static int visconti_gpio_probe(struct platform_device *pdev)
struct gpio_irq_chip *girq; struct gpio_irq_chip *girq;
struct irq_domain *parent; struct irq_domain *parent;
struct device_node *irq_parent; struct device_node *irq_parent;
struct fwnode_handle *fwnode;
int ret; int ret;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
...@@ -150,14 +149,12 @@ static int visconti_gpio_probe(struct platform_device *pdev) ...@@ -150,14 +149,12 @@ static int visconti_gpio_probe(struct platform_device *pdev)
} }
parent = irq_find_host(irq_parent); parent = irq_find_host(irq_parent);
of_node_put(irq_parent);
if (!parent) { if (!parent) {
dev_err(dev, "No IRQ parent domain\n"); dev_err(dev, "No IRQ parent domain\n");
return -ENODEV; return -ENODEV;
} }
fwnode = of_node_to_fwnode(irq_parent);
of_node_put(irq_parent);
ret = bgpio_init(&priv->gpio_chip, dev, 4, ret = bgpio_init(&priv->gpio_chip, dev, 4,
priv->base + GPIO_IDATA, priv->base + GPIO_IDATA,
priv->base + GPIO_OSET, priv->base + GPIO_OSET,
...@@ -180,7 +177,7 @@ static int visconti_gpio_probe(struct platform_device *pdev) ...@@ -180,7 +177,7 @@ static int visconti_gpio_probe(struct platform_device *pdev)
girq = &priv->gpio_chip.irq; girq = &priv->gpio_chip.irq;
girq->chip = irq_chip; girq->chip = irq_chip;
girq->fwnode = fwnode; girq->fwnode = of_node_to_fwnode(dev->of_node);
girq->parent_domain = parent; girq->parent_domain = parent;
girq->child_to_parent_hwirq = visconti_gpio_child_to_parent_hwirq; girq->child_to_parent_hwirq = visconti_gpio_child_to_parent_hwirq;
girq->populate_parent_alloc_arg = visconti_gpio_populate_parent_fwspec; girq->populate_parent_alloc_arg = visconti_gpio_populate_parent_fwspec;
......
...@@ -910,7 +910,7 @@ static void of_gpiochip_init_valid_mask(struct gpio_chip *chip) ...@@ -910,7 +910,7 @@ static void of_gpiochip_init_valid_mask(struct gpio_chip *chip)
i, &start); i, &start);
of_property_read_u32_index(np, "gpio-reserved-ranges", of_property_read_u32_index(np, "gpio-reserved-ranges",
i + 1, &count); i + 1, &count);
if (start >= chip->ngpio || start + count >= chip->ngpio) if (start >= chip->ngpio || start + count > chip->ngpio)
continue; continue;
bitmap_clear(chip->valid_mask, start, count); bitmap_clear(chip->valid_mask, start, count);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment