From: Dan Carpenter <dan.carpenter@oracle.com> To: arm@kernel.org Cc: Krzysztof Halasa <khalasa@piap.pl>, Linus Walleij <linus.walleij@linaro.org>, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] soc: ixp4xx: npe: Fix an IS_ERR() vs NULL check in probe Date: Tue, 18 Jun 2019 14:54:10 +0300 [thread overview] Message-ID: <20190618115410.GE18776@kadam> (raw) In-Reply-To: <CACRpkdaX66=g7dG7SFkgr5Dwmop-p4qe7ELkn0KERtqVvp0vNA@mail.gmail.com> The devm_ioremap_resource() function doesn't return NULL, it returns error pointers. Fixes: 0b458d7b10f8 ("soc: ixp4xx: npe: Pass addresses as resources") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> --- drivers/soc/ixp4xx/ixp4xx-npe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/ixp4xx/ixp4xx-npe.c b/drivers/soc/ixp4xx/ixp4xx-npe.c index bc10e3194809..ec90b44fa0cd 100644 --- a/drivers/soc/ixp4xx/ixp4xx-npe.c +++ b/drivers/soc/ixp4xx/ixp4xx-npe.c @@ -695,8 +695,8 @@ static int ixp4xx_npe_probe(struct platform_device *pdev) continue; /* NPE already disabled or not present */ } npe->regs = devm_ioremap_resource(dev, res); - if (!npe->regs) - return -ENOMEM; + if (IS_ERR(npe->regs)) + return PTR_ERR(npe->regs); if (npe_reset(npe)) { dev_info(dev, "NPE%d at 0x%08x-0x%08x does not reset\n", -- 2.20.1
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com> To: arm@kernel.org Cc: Krzysztof Halasa <khalasa@piap.pl>, Linus Walleij <linus.walleij@linaro.org>, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] soc: ixp4xx: npe: Fix an IS_ERR() vs NULL check in probe Date: Tue, 18 Jun 2019 11:54:10 +0000 [thread overview] Message-ID: <20190618115410.GE18776@kadam> (raw) In-Reply-To: <CACRpkdaX66=g7dG7SFkgr5Dwmop-p4qe7ELkn0KERtqVvp0vNA@mail.gmail.com> In-Reply-To: <20190613070201.GH16334@mwanda> The devm_ioremap_resource() function doesn't return NULL, it returns error pointers. Fixes: 0b458d7b10f8 ("soc: ixp4xx: npe: Pass addresses as resources") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> --- drivers/soc/ixp4xx/ixp4xx-npe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/ixp4xx/ixp4xx-npe.c b/drivers/soc/ixp4xx/ixp4xx-npe.c index bc10e3194809..ec90b44fa0cd 100644 --- a/drivers/soc/ixp4xx/ixp4xx-npe.c +++ b/drivers/soc/ixp4xx/ixp4xx-npe.c @@ -695,8 +695,8 @@ static int ixp4xx_npe_probe(struct platform_device *pdev) continue; /* NPE already disabled or not present */ } npe->regs = devm_ioremap_resource(dev, res); - if (!npe->regs) - return -ENOMEM; + if (IS_ERR(npe->regs)) + return PTR_ERR(npe->regs); if (npe_reset(npe)) { dev_info(dev, "NPE%d at 0x%08x-0x%08x does not reset\n", -- 2.20.1
next prev parent reply other threads:[~2019-06-18 11:54 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-06-13 7:02 [PATCH] soc: ixp4xx: npe: Fix an IS_ERR() vs NULL check in probe Dan Carpenter 2019-06-13 7:02 ` Dan Carpenter 2019-06-18 11:35 ` Linus Walleij 2019-06-18 11:35 ` Linus Walleij 2019-06-18 11:54 ` Dan Carpenter [this message] 2019-06-18 11:54 ` Dan Carpenter 2019-06-18 13:48 ` Olof Johansson 2019-06-18 13:48 ` Olof Johansson
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190618115410.GE18776@kadam \ --to=dan.carpenter@oracle.com \ --cc=arm@kernel.org \ --cc=kernel-janitors@vger.kernel.org \ --cc=khalasa@piap.pl \ --cc=linus.walleij@linaro.org \ --cc=linux-kernel@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.