提交 bb14bfc7 编写于 作者: D Dan Carpenter 提交者: David S. Miller

net: lan966x: fix a IS_ERR() vs NULL check in lan966x_create_targets()

The devm_ioremap() function does not return error pointers.  It returns
NULL.

Fixes: db8bcaad ("net: lan966x: add the basic lan966x driver")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NHoratiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f6882b8f
...@@ -83,10 +83,10 @@ static int lan966x_create_targets(struct platform_device *pdev, ...@@ -83,10 +83,10 @@ static int lan966x_create_targets(struct platform_device *pdev,
begin[idx] = devm_ioremap(&pdev->dev, begin[idx] = devm_ioremap(&pdev->dev,
iores[idx]->start, iores[idx]->start,
resource_size(iores[idx])); resource_size(iores[idx]));
if (IS_ERR(begin[idx])) { if (!begin[idx]) {
dev_err(&pdev->dev, "Unable to get registers: %s\n", dev_err(&pdev->dev, "Unable to get registers: %s\n",
iores[idx]->name); iores[idx]->name);
return PTR_ERR(begin[idx]); return -ENOMEM;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册