From: Dan Carpenter Date: Wed, 19 Sep 2018 10:35:00 +0000 (+0300) Subject: thermal: armada: fix a test in probe() X-Git-Tag: v4.19.87~178 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=733fddc346515d1d44c577efa7d36cb02fb57a3f;p=thirdparty%2Fkernel%2Fstable.git thermal: armada: fix a test in probe() [ Upstream commit d1d2c290b3c04b65fa6132eeebe50a070746d8f6 ] The platform_get_resource() function doesn't return error pointers, it returns NULL on error. Fixes: 3d4e51844a4e ("thermal: armada: convert driver to syscon register accesses") Signed-off-by: Dan Carpenter Reviewed-by: Miquel Raynal Signed-off-by: Eduardo Valentin Signed-off-by: Sasha Levin --- diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c index e16b3cb1808c5..1c9830b2c84da 100644 --- a/drivers/thermal/armada_thermal.c +++ b/drivers/thermal/armada_thermal.c @@ -526,8 +526,8 @@ static int armada_thermal_probe_legacy(struct platform_device *pdev, /* First memory region points towards the status register */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (IS_ERR(res)) - return PTR_ERR(res); + if (!res) + return -EIO; /* * Edit the resource start address and length to map over all the