Skip to content

Commit bcd14bb

Browse files
seehearfeelgregkh
authored andcommitted
nvmem: sprd: Fix return value of sprd_efuse_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: 096030e ("nvmem: sprd: Add Spreadtrum SoCs eFuse support") Signed-off-by: Tiezhu Yang <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 7e84522 commit bcd14bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/nvmem/sprd-efuse.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,8 @@ static int sprd_efuse_probe(struct platform_device *pdev)
378378
return -ENOMEM;
379379

380380
efuse->base = devm_platform_ioremap_resource(pdev, 0);
381-
if (!efuse->base)
382-
return -ENOMEM;
381+
if (IS_ERR(efuse->base))
382+
return PTR_ERR(efuse->base);
383383

384384
ret = of_hwspin_lock_get_id(np, 0);
385385
if (ret < 0) {

0 commit comments

Comments
 (0)