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

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.mountain


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b44abdd2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
	}