projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1d85049
)
sfp: Fix error handing in sfp_probe()
author
YueHaibing
<yuehaibing@huawei.com>
Sat, 31 Oct 2020 03:10:53 +0000
(11:10 +0800)
committer
Jakub Kicinski
<kuba@kernel.org>
Tue, 3 Nov 2020 01:19:59 +0000
(17:19 -0800)
gpiod_to_irq() never return 0, but returns negative in
case of error, check it and set gpio_irq to 0.
Fixes:
73970055450e
("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>
drivers/net/phy/sfp.c
patch
|
blob
|
history
diff --git
a/drivers/net/phy/sfp.c
b/drivers/net/phy/sfp.c
index
1d18c10
..
34aa196
100644
(file)
--- a/
drivers/net/phy/sfp.c
+++ b/
drivers/net/phy/sfp.c
@@
-2389,7
+2389,8
@@
static int sfp_probe(struct platform_device *pdev)
continue;
sfp->gpio_irq[i] = gpiod_to_irq(sfp->gpio[i]);
- if (!sfp->gpio_irq[i]) {
+ if (sfp->gpio_irq[i] < 0) {
+ sfp->gpio_irq[i] = 0;
sfp->need_poll = true;
continue;
}