sfp: Fix error handing in sfp_probe()
authorYueHaibing <yuehaibing@huawei.com>
Sat, 31 Oct 2020 03:10:53 +0000 (11:10 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Nov 2020 11:35:54 +0000 (12:35 +0100)
commit4ff840604a45673bb02dfaaa5f30cd9bc40011e5
tree826dd13016eaf1aab3c66407c9988d493f0002f4
parent64752f5cfda61aa7ca12d23ca1ecc7d36e996f93
sfp: Fix error handing in sfp_probe()

[ Upstream commit 9621618130bf7e83635367c13b9a6ee53935bb37 ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/phy/sfp.c