Commit da2c4f33 authored by Gopi Krishna Menon's avatar Gopi Krishna Menon Committed by Daniel Lezcano
Browse files

thermal/drivers/spear: Fix error condition for reading st,thermal-flags



of_property_read_u32 returns 0 on success. The current check returns
-EINVAL if the property is read successfully.

Fix the check by removing ! from of_property_read_u32

Fixes: b9c7aff4 ("drivers/thermal/spear_thermal.c: add Device Tree probing capability")
Signed-off-by: default avatarGopi Krishna Menon <krishnagopi487@gmail.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@kernel.org>
Suggested-by: default avatarDaniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: default avatarLukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/20260327090526.59330-1-krishnagopi487@gmail.com
parent 85f18edd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ static int spear_thermal_probe(struct platform_device *pdev)
	struct device_node *np = pdev->dev.of_node;
	int ret = 0, val;

	if (!np || !of_property_read_u32(np, "st,thermal-flags", &val)) {
	if (!np || of_property_read_u32(np, "st,thermal-flags", &val)) {
		dev_err(&pdev->dev, "Failed: DT Pdata not passed\n");
		return -EINVAL;
	}