Skip to content

Commit

Permalink
nvmem: sprd: Fix return value of sprd_efuse_probe()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Tiezhu Yang authored and gregkh committed Jul 29, 2020
1 parent 7e84522 commit bcd14bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/nvmem/sprd-efuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,8 @@ static int sprd_efuse_probe(struct platform_device *pdev)
return -ENOMEM;

efuse->base = devm_platform_ioremap_resource(pdev, 0);
if (!efuse->base)
return -ENOMEM;
if (IS_ERR(efuse->base))
return PTR_ERR(efuse->base);

ret = of_hwspin_lock_get_id(np, 0);
if (ret < 0) {
Expand Down

0 comments on commit bcd14bb

Please sign in to comment.