mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-26 20:40:24 +09:00
sfp: Fix error handing in sfp_probe()
[ Upstream commit9621618130] gpiod_to_irq() never return 0, but returns negative in case of error, check it and set gpio_irq to 0. Fixes:7397005545("sfp: add SFP module support") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/20201031031053.25264-1-yuehaibing@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
64752f5cfd
commit
4ff840604a
@@ -1886,7 +1886,8 @@ static int sfp_probe(struct platform_device *pdev)
|
||||
continue;
|
||||
|
||||
irq = gpiod_to_irq(sfp->gpio[i]);
|
||||
if (!irq) {
|
||||
if (irq < 0) {
|
||||
irq = 0;
|
||||
poll = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user