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: db8bcaad5393 ("net: lan966x: add the basic lan966x driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Dan Carpenter 2021-12-03 12:55:31 +03:00 committed by David S. Miller
parent f6882b8fac
commit bb14bfc7eb

View File

@ -83,10 +83,10 @@ static int lan966x_create_targets(struct platform_device *pdev,
begin[idx] = devm_ioremap(&pdev->dev,
iores[idx]->start,
resource_size(iores[idx]));
if (IS_ERR(begin[idx])) {
if (!begin[idx]) {
dev_err(&pdev->dev, "Unable to get registers: %s\n",
iores[idx]->name);
return PTR_ERR(begin[idx]);
return -ENOMEM;
}
}