Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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'

+6 -16
+1 -1
MAINTAINERS
··· 8385 8385 M: Bartosz Golaszewski <brgl@bgdev.pl> 8386 8386 L: linux-gpio@vger.kernel.org 8387 8387 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 8389 8389 F: Documentation/ABI/obsolete/sysfs-gpio 8390 8390 F: Documentation/ABI/testing/gpio-cdev 8391 8391 F: Documentation/admin-guide/gpio/
-7
drivers/gpio/gpio-mvebu.c
··· 871 871 mvpwm->chip.dev = dev; 872 872 mvpwm->chip.ops = &mvebu_pwm_ops; 873 873 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; 881 874 882 875 spin_lock_init(&mvpwm->lock); 883 876
+2 -2
drivers/gpio/gpio-pca953x.c
··· 762 762 bitmap_xor(cur_stat, new_stat, old_stat, gc->ngpio); 763 763 bitmap_and(trigger, cur_stat, chip->irq_mask, gc->ngpio); 764 764 765 + bitmap_copy(chip->irq_stat, new_stat, gc->ngpio); 766 + 765 767 if (bitmap_empty(trigger, gc->ngpio)) 766 768 return false; 767 - 768 - bitmap_copy(chip->irq_stat, new_stat, gc->ngpio); 769 769 770 770 bitmap_and(cur_stat, chip->irq_trig_fall, old_stat, gc->ngpio); 771 771 bitmap_and(old_stat, chip->irq_trig_raise, new_stat, gc->ngpio);
+2 -5
drivers/gpio/gpio-visconti.c
··· 130 130 struct gpio_irq_chip *girq; 131 131 struct irq_domain *parent; 132 132 struct device_node *irq_parent; 133 - struct fwnode_handle *fwnode; 134 133 int ret; 135 134 136 135 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); ··· 149 150 } 150 151 151 152 parent = irq_find_host(irq_parent); 153 + of_node_put(irq_parent); 152 154 if (!parent) { 153 155 dev_err(dev, "No IRQ parent domain\n"); 154 156 return -ENODEV; 155 157 } 156 - 157 - fwnode = of_node_to_fwnode(irq_parent); 158 - of_node_put(irq_parent); 159 158 160 159 ret = bgpio_init(&priv->gpio_chip, dev, 4, 161 160 priv->base + GPIO_IDATA, ··· 177 180 178 181 girq = &priv->gpio_chip.irq; 179 182 girq->chip = irq_chip; 180 - girq->fwnode = fwnode; 183 + girq->fwnode = of_node_to_fwnode(dev->of_node); 181 184 girq->parent_domain = parent; 182 185 girq->child_to_parent_hwirq = visconti_gpio_child_to_parent_hwirq; 183 186 girq->populate_parent_alloc_arg = visconti_gpio_populate_parent_fwspec;
+1 -1
drivers/gpio/gpiolib-of.c
··· 910 910 i, &start); 911 911 of_property_read_u32_index(np, "gpio-reserved-ranges", 912 912 i + 1, &count); 913 - if (start >= chip->ngpio || start + count >= chip->ngpio) 913 + if (start >= chip->ngpio || start + count > chip->ngpio) 914 914 continue; 915 915 916 916 bitmap_clear(chip->valid_mask, start, count);