Message ID | 1473990601-18721-1-git-send-email-weiyj.lk@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Herbert Xu |
Headers | show |
On Fri, Sep 16, 2016 at 01:50:01AM +0000, Wei Yongjun wrote: > From: Wei Yongjun <weiyongjun1@huawei.com> > > In case of error, the function devm_ioremap() returns NULL pointer > not ERR_PTR(). The IS_ERR() test in the return value check should > be replaced with NULL test. > > Fixes: 6e9b5e76882c ("hwrng: geode - Migrate to managed API") > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Patch applied. Thanks.
diff --git a/drivers/char/hw_random/geode-rng.c b/drivers/char/hw_random/geode-rng.c index 0cae210..e7a2459 100644 --- a/drivers/char/hw_random/geode-rng.c +++ b/drivers/char/hw_random/geode-rng.c @@ -95,8 +95,8 @@ static int __init mod_init(void) return -ENODEV; mem = devm_ioremap(&pdev->dev, rng_base, 0x58); - if (IS_ERR(mem)) - return PTR_ERR(mem); + if (!mem) + return -ENOMEM; geode_rng.priv = (unsigned long)mem; pr_info("AMD Geode RNG detected\n");