Skip to content

Commit b414791

Browse files
seehearfeeldlezcano
authored andcommitted
thermal/drivers/sprd: Fix return value of sprd_thm_probe()
When call function devm_platform_ioremap_resource(), we should use IS_ERR() to check the return value and return PTR_ERR() if failed. Fixes: 554fdba ("thermal: sprd: Add Spreadtrum thermal driver support") Signed-off-by: Tiezhu Yang <[email protected]> Reviewed-by: Baolin Wang <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 14533a5 commit b414791

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/thermal/sprd_thermal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@ static int sprd_thm_probe(struct platform_device *pdev)
348348

349349
thm->var_data = pdata;
350350
thm->base = devm_platform_ioremap_resource(pdev, 0);
351-
if (!thm->base)
352-
return -ENOMEM;
351+
if (IS_ERR(thm->base))
352+
return PTR_ERR(thm->base);
353353

354354
thm->nr_sensors = of_get_child_count(np);
355355
if (thm->nr_sensors == 0 || thm->nr_sensors > SPRD_THM_MAX_SENSOR) {

0 commit comments

Comments
 (0)