Bladeren bron

thermal: armada: fix a test in probe()

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 <dan.carpenter@oracle.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Dan Carpenter 6 jaren geleden
bovenliggende
commit
d1d2c290b3
1 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  1. 2 2
      drivers/thermal/armada_thermal.c

+ 2 - 2
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