Skip to contentSkip to conversation

thermal: bcm2835: fix an error code in probe()

PATCH In review Dan Carpenter 2 participants 2 messages Jun 14, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal: bcm2835: fix an error code in probe()

This causes a static checker because we're passing a valid pointer to PTR_ERR(). "err" is already the correct error code, so we can just delete this line.

Fixes bcb7dd9ef206 ("thermal: bcm2835: add thermal driver for bcm2835 SoC")
drivers/thermal/broadcom/bcm2835_thermal.c +0 -1
index 0ecf80890c84..e6863c841662 100644
@@ -245,7 +245,6 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
 		 */
 		err = tz->ops->get_trip_temp(tz, 0, &trip_temp);
 		if (err < 0) {
-			err = PTR_ERR(tz);
 			dev_err(&pdev->dev,
 				"Not able to read trip_temp: %d\n",
 				err);
Acked-by on v1 1/1
#1 lore raw
Quoted 16 lines

Dan Carpenter <[email protected]> hat am 14. Juni 2017 um 11:13 geschrieben:

This causes a static checker because we're passing a valid pointer to PTR_ERR(). "err" is already the correct error code, so we can just delete this line.

Fixes bcb7dd9ef206 ("thermal: bcm2835: add thermal driver for bcm2835 SoC")
drivers/thermal/broadcom/bcm2835_thermal.c +0 -0
index 0ecf80890c84..e6863c841662 100644

drivers/thermal/broadcom/bcm2835_thermal.c static int bcm2835_thermal_probe(struct platform_device *pdev) · line 250

Quoted 7 lines
drivers/thermal/broadcom/bcm2835_thermal.c +0 -1
@@ -245,7 +245,6 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
 		 */
 		err = tz->ops->get_trip_temp(tz, 0, &trip_temp);
 		if (err < 0) {
-			err = PTR_ERR(tz);
 			dev_err(&pdev->dev,
 				"Not able to read trip_temp: %d\n",
 				err);

Thanks
Stefan