phy: phy-ocelot-serdes: fix return value check in serdes_probe()

In case of error, the function syscon_node_to_regmap() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().

Fixes: 51f6b410fc ("phy: add driver for Microsemi Ocelot SerDes muxing")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Quentin Schulz <quentin.schulz@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Wei Yongjun 2018-10-10 02:00:24 +00:00 committed by David S. Miller
parent 302d20e57a
commit 9047fa5d32
1 changed files with 2 additions and 2 deletions

View File

@ -257,8 +257,8 @@ static int serdes_probe(struct platform_device *pdev)
ctrl->dev = &pdev->dev; ctrl->dev = &pdev->dev;
ctrl->regs = syscon_node_to_regmap(pdev->dev.parent->of_node); ctrl->regs = syscon_node_to_regmap(pdev->dev.parent->of_node);
if (!ctrl->regs) if (IS_ERR(ctrl->regs))
return -ENODEV; return PTR_ERR(ctrl->regs);
for (i = 0; i <= SERDES_MAX; i++) { for (i = 0; i <= SERDES_MAX; i++) {
ret = serdes_phy_create(ctrl, i, &ctrl->phys[i]); ret = serdes_phy_create(ctrl, i, &ctrl->phys[i]);