Commit 316459ba authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

char: xilinx_hwicap: Fix NULL vs IS_ERR() bug

The devm_platform_ioremap_resource() function returns error pointers.
It never returns NULL.  Update the check accordingly.

Fixes: 67237183 ("char: xilinx_hwicap: Modernize driver probe")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Acked-by: default avatarMichal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ef647a9c-b1b7-4338-9bc0-28165ec2a367@moroto.mountainSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b44abdd2
......@@ -639,8 +639,8 @@ static int hwicap_setup(struct platform_device *pdev, int id,
dev_set_drvdata(dev, drvdata);
drvdata->base_address = devm_platform_ioremap_resource(pdev, 0);
if (!drvdata->base_address) {
retval = -ENODEV;
if (IS_ERR(drvdata->base_address)) {
retval = PTR_ERR(drvdata->base_address);
goto failed;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment