Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 733fddc3 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman
Browse files

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: 3d4e5184 ("thermal: armada: convert driver to syscon register accesses")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent bb925b9b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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