From: Esben Haabendal <esben@geanix.com>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: <michal.simek@xilinx.com>, <andrew@lunn.ch>, <ynezz@true.cz>,
<netdev@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>,
<kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH net-next] net: ll_temac: Fix return value check in temac_probe()
Date: Mon, 27 Apr 2020 11:46:10 +0200 [thread overview]
Message-ID: <87sggpp8gt.fsf@geanix.com> (raw)
In-Reply-To: <20200427094052.181554-1-weiyongjun1@huawei.com> (Wei Yongjun's message of "Mon, 27 Apr 2020 09:40:52 +0000")
Acked-by: Esben Haabendal <esben@geanix.com>
Wei Yongjun <weiyongjun1@huawei.com> writes:
> 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.
>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/net/ethernet/xilinx/ll_temac_main.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
> index 3e313e71ae36..929244064abd 100644
> --- a/drivers/net/ethernet/xilinx/ll_temac_main.c
> +++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
> @@ -1410,9 +1410,9 @@ static int temac_probe(struct platform_device *pdev)
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> lp->regs = devm_ioremap(&pdev->dev, res->start,
> resource_size(res));
> - if (IS_ERR(lp->regs)) {
> + if (!lp->regs) {
> dev_err(&pdev->dev, "could not map TEMAC registers\n");
> - return PTR_ERR(lp->regs);
> + return -ENOMEM;
> }
>
> /* Select register access functions with the specified
> @@ -1505,10 +1505,10 @@ static int temac_probe(struct platform_device *pdev)
> res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> lp->sdma_regs = devm_ioremap(&pdev->dev, res->start,
> resource_size(res));
> - if (IS_ERR(lp->sdma_regs)) {
> + if (!lp->sdma_regs) {
> dev_err(&pdev->dev,
> "could not map DMA registers\n");
> - return PTR_ERR(lp->sdma_regs);
> + return -ENOMEM;
> }
> if (pdata->dma_little_endian) {
> lp->dma_in = temac_dma_in32_le;
next prev parent reply other threads:[~2020-04-27 9:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-27 9:40 [PATCH net-next] net: ll_temac: Fix return value check in temac_probe() Wei Yongjun
2020-04-27 9:46 ` Esben Haabendal [this message]
2020-05-01 3:39 ` David Miller
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=87sggpp8gt.fsf@geanix.com \
--to=esben@geanix.com \
--cc=andrew@lunn.ch \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=michal.simek@xilinx.com \
--cc=netdev@vger.kernel.org \
--cc=weiyongjun1@huawei.com \
--cc=ynezz@true.cz \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).