mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-06 05:06:29 +00:00
gpio: sifive: add missing check for platform_get_irq
[ Upstream commitc1bcb976d8
] Add the missing check for platform_get_irq() and return error code if it fails. The returned error code will be dealed with in builtin_platform_driver(sifive_gpio_driver) and the driver will not be registered. Fixes:f52d6d8b43
("gpio: sifive: To get gpio irq offset from device tree data") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
497d401408
commit
1cc379d53b
@ -215,8 +215,12 @@ static int sifive_gpio_probe(struct platform_device *pdev)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
for (i = 0; i < ngpio; i++)
|
||||
chip->irq_number[i] = platform_get_irq(pdev, i);
|
||||
for (i = 0; i < ngpio; i++) {
|
||||
ret = platform_get_irq(pdev, i);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
chip->irq_number[i] = ret;
|
||||
}
|
||||
|
||||
ret = bgpio_init(&chip->gc, dev, 4,
|
||||
chip->base + SIFIVE_GPIO_INPUT_VAL,
|
||||
|
Loading…
Reference in New Issue
Block a user