diff options
author | 2020-05-25 09:59:01 +0800 | |
---|---|---|
committer | 2020-06-29 12:14:07 +0200 | |
commit | b4147917ad4ff2c755e01a7ca296b14030d2d507 (patch) | |
tree | 153764ca0577629f6575bd35f1bc5113fb4198a5 /drivers/thermal | |
parent | thermal/drivers/mediatek: Fix bank number settings on mt8183 (diff) | |
download | wireguard-linux-b4147917ad4ff2c755e01a7ca296b14030d2d507.tar.xz wireguard-linux-b4147917ad4ff2c755e01a7ca296b14030d2d507.zip |
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: 554fdbaf19b1 ("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]
Diffstat (limited to 'drivers/thermal')
-rw-r--r-- | drivers/thermal/sprd_thermal.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/thermal/sprd_thermal.c b/drivers/thermal/sprd_thermal.c index a340374e8c51..4cde70dcf655 100644 --- a/drivers/thermal/sprd_thermal.c +++ b/drivers/thermal/sprd_thermal.c @@ -348,8 +348,8 @@ static int sprd_thm_probe(struct platform_device *pdev) thm->var_data = pdata; thm->base = devm_platform_ioremap_resource(pdev, 0); - if (!thm->base) - return -ENOMEM; + if (IS_ERR(thm->base)) + return PTR_ERR(thm->base); thm->nr_sensors = of_get_child_count(np); if (thm->nr_sensors == 0 || thm->nr_sensors > SPRD_THM_MAX_SENSOR) { |