Commit cc70ce8f authored by Linus Torvalds's avatar Linus Torvalds

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

Pull gpio fixes from Bartosz Golaszewski:

 - fix a potential NULL-pointer dereference in gpiolib core

 - fix a probe() regression from the v6.12 merge window and an older bug
   leading to missed interrupts in gpio-davinci

* tag 'gpio-fixes-for-v6.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
  gpiolib: Fix potential NULL pointer dereference in gpiod_get_label()
  gpio: davinci: Fix condition for irqchip registration
  gpio: davinci: fix lazy disable
parents 2f91ff27 7b99b5ab
...@@ -253,7 +253,7 @@ static int davinci_gpio_probe(struct platform_device *pdev) ...@@ -253,7 +253,7 @@ static int davinci_gpio_probe(struct platform_device *pdev)
* serve as EDMA event triggers. * serve as EDMA event triggers.
*/ */
static void gpio_irq_disable(struct irq_data *d) static void gpio_irq_mask(struct irq_data *d)
{ {
struct davinci_gpio_regs __iomem *g = irq2regs(d); struct davinci_gpio_regs __iomem *g = irq2regs(d);
uintptr_t mask = (uintptr_t)irq_data_get_irq_handler_data(d); uintptr_t mask = (uintptr_t)irq_data_get_irq_handler_data(d);
...@@ -262,7 +262,7 @@ static void gpio_irq_disable(struct irq_data *d) ...@@ -262,7 +262,7 @@ static void gpio_irq_disable(struct irq_data *d)
writel_relaxed(mask, &g->clr_rising); writel_relaxed(mask, &g->clr_rising);
} }
static void gpio_irq_enable(struct irq_data *d) static void gpio_irq_unmask(struct irq_data *d)
{ {
struct davinci_gpio_regs __iomem *g = irq2regs(d); struct davinci_gpio_regs __iomem *g = irq2regs(d);
uintptr_t mask = (uintptr_t)irq_data_get_irq_handler_data(d); uintptr_t mask = (uintptr_t)irq_data_get_irq_handler_data(d);
...@@ -288,8 +288,8 @@ static int gpio_irq_type(struct irq_data *d, unsigned trigger) ...@@ -288,8 +288,8 @@ static int gpio_irq_type(struct irq_data *d, unsigned trigger)
static struct irq_chip gpio_irqchip = { static struct irq_chip gpio_irqchip = {
.name = "GPIO", .name = "GPIO",
.irq_enable = gpio_irq_enable, .irq_unmask = gpio_irq_unmask,
.irq_disable = gpio_irq_disable, .irq_mask = gpio_irq_mask,
.irq_set_type = gpio_irq_type, .irq_set_type = gpio_irq_type,
.flags = IRQCHIP_SET_TYPE_MASKED | IRQCHIP_SKIP_SET_WAKE, .flags = IRQCHIP_SET_TYPE_MASKED | IRQCHIP_SKIP_SET_WAKE,
}; };
...@@ -472,7 +472,7 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev) ...@@ -472,7 +472,7 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev)
return PTR_ERR(clk); return PTR_ERR(clk);
} }
if (chips->gpio_unbanked) { if (!chips->gpio_unbanked) {
irq = devm_irq_alloc_descs(dev, -1, 0, ngpio, 0); irq = devm_irq_alloc_descs(dev, -1, 0, ngpio, 0);
if (irq < 0) { if (irq < 0) {
dev_err(dev, "Couldn't allocate IRQ numbers\n"); dev_err(dev, "Couldn't allocate IRQ numbers\n");
......
...@@ -114,12 +114,12 @@ const char *gpiod_get_label(struct gpio_desc *desc) ...@@ -114,12 +114,12 @@ const char *gpiod_get_label(struct gpio_desc *desc)
srcu_read_lock_held(&desc->gdev->desc_srcu)); srcu_read_lock_held(&desc->gdev->desc_srcu));
if (test_bit(FLAG_USED_AS_IRQ, &flags)) if (test_bit(FLAG_USED_AS_IRQ, &flags))
return label->str ?: "interrupt"; return label ? label->str : "interrupt";
if (!test_bit(FLAG_REQUESTED, &flags)) if (!test_bit(FLAG_REQUESTED, &flags))
return NULL; return NULL;
return label->str; return label ? label->str : NULL;
} }
static void desc_free_label(struct rcu_head *rh) static void desc_free_label(struct rcu_head *rh)
......
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