mdio_bus: Fix PTR_ERR() usage after initialization to constant
authorYueHaibing <yuehaibing@huawei.com>
Sat, 16 Feb 2019 02:59:35 +0000 (10:59 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:50:24 +0000 (14:50 +0100)
commite51170e7e7d7c8218823b3155f3edcb5350b8f12
tree65710904c4b2ea5766a3fff2b12945c89883353c
parentdd19e541758882a2aea3f85412c0ba61b6481056
mdio_bus: Fix PTR_ERR() usage after initialization to constant

[ Upstream commit 780feae7eb69388c8d8b661cda6706b0dc0f642b ]

Fix coccinelle warning:

./drivers/net/phy/mdio_bus.c:51:5-12: ERROR: PTR_ERR applied after initialization to constant on line 44
./drivers/net/phy/mdio_bus.c:52:5-12: ERROR: PTR_ERR applied after initialization to constant on line 44

fix this by using IS_ERR before PTR_ERR

Fixes: bafbdd527d56 ("phylib: Add device reset GPIO support")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/phy/mdio_bus.c