Commit bcd14bb7 authored by Tiezhu Yang's avatar Tiezhu Yang Committed by Greg Kroah-Hartman

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: 096030e7 ("nvmem: sprd: Add Spreadtrum SoCs eFuse support")
Signed-off-by: default avatarTiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200722100705.7772-2-srinivas.kandagatla@linaro.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7e84522c
...@@ -378,8 +378,8 @@ static int sprd_efuse_probe(struct platform_device *pdev) ...@@ -378,8 +378,8 @@ static int sprd_efuse_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
efuse->base = devm_platform_ioremap_resource(pdev, 0); efuse->base = devm_platform_ioremap_resource(pdev, 0);
if (!efuse->base) if (IS_ERR(efuse->base))
return -ENOMEM; return PTR_ERR(efuse->base);
ret = of_hwspin_lock_get_id(np, 0); ret = of_hwspin_lock_get_id(np, 0);
if (ret < 0) { if (ret < 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment