Skip to content

Commit 2c271fe

Browse files
committed
Merge tag 'gpio-fixes-for-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux
Pull gpio fixes from Bartosz Golaszewski: "Fix the same error check issue in two drivers. And then the drivers are fixed even more because the first patches were incomplete which I missed. Summary: - fix the error checks of platform_get_irq() in gpio-mpc8xxx and gpio-idt3243x" * tag 'gpio-fixes-for-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: mpc8xxx: Fix an ignored error return from platform_get_irq() gpio: idt3243x: Fix an ignored error return from platform_get_irq() gpio: idt3243x: Fix IRQ check in idt_gpio_probe gpio: mpc8xxx: Fix IRQ check in mpc8xxx_probe
2 parents 64f29d8 + 9f51ce0 commit 2c271fe

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

drivers/gpio/gpio-idt3243x.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static int idt_gpio_probe(struct platform_device *pdev)
132132
struct device *dev = &pdev->dev;
133133
struct gpio_irq_chip *girq;
134134
struct idt_gpio_ctrl *ctrl;
135-
unsigned int parent_irq;
135+
int parent_irq;
136136
int ngpios;
137137
int ret;
138138

@@ -164,8 +164,8 @@ static int idt_gpio_probe(struct platform_device *pdev)
164164
return PTR_ERR(ctrl->pic);
165165

166166
parent_irq = platform_get_irq(pdev, 0);
167-
if (!parent_irq)
168-
return -EINVAL;
167+
if (parent_irq < 0)
168+
return parent_irq;
169169

170170
girq = &ctrl->gc.irq;
171171
girq->chip = &idt_gpio_irqchip;

drivers/gpio/gpio-mpc8xxx.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct mpc8xxx_gpio_chip {
4747
unsigned offset, int value);
4848

4949
struct irq_domain *irq;
50-
unsigned int irqn;
50+
int irqn;
5151
};
5252

5353
/*
@@ -388,8 +388,8 @@ static int mpc8xxx_probe(struct platform_device *pdev)
388388
}
389389

390390
mpc8xxx_gc->irqn = platform_get_irq(pdev, 0);
391-
if (!mpc8xxx_gc->irqn)
392-
return 0;
391+
if (mpc8xxx_gc->irqn < 0)
392+
return mpc8xxx_gc->irqn;
393393

394394
mpc8xxx_gc->irq = irq_domain_create_linear(fwnode,
395395
MPC8XXX_GPIO_PINS,

0 commit comments

Comments
 (0)