From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jonas Gorski <jogo@openwrt.org>
Cc: Mark Brown <broonie@kernel.org>,
linux-spi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] spi: bcm63xx-hsspi: checking for ERR_PTR instead of NULL
Date: Fri, 6 Dec 2013 16:34:30 +0300 [thread overview]
Message-ID: <20131206133430.GF28413@mwanda> (raw)
In-Reply-To: <CAOiHx=k87c_bFqFtJ7zJc9HxnjOEr2oMofNUsLkQbfQPrC04hQ@mail.gmail.com>
On Fri, Dec 06, 2013 at 02:08:08PM +0100, Jonas Gorski wrote:
> On Fri, Dec 6, 2013 at 1:58 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > devm_request_and_ioremap() returns NULL on error, it doesn't return an
> > ERR_PTR().
> >
> > Fixes: 142168eba9dc ('spi: bcm63xx-hsspi: add bcm63xx HSSPI driver')
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> >
> > diff --git a/drivers/spi/spi-bcm63xx-hsspi.c b/drivers/spi/spi-bcm63xx-hsspi.c
> > index bc8d848d33b7..da9f85d55c81 100644
> > --- a/drivers/spi/spi-bcm63xx-hsspi.c
> > +++ b/drivers/spi/spi-bcm63xx-hsspi.c
> > @@ -339,8 +339,8 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev)
> >
> > res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > regs = devm_request_and_ioremap(dev, res_mem);
> > - if (IS_ERR(regs))
> > - return PTR_ERR(regs);
> > + if (!regs)
> > + return -EADDRNOTAVAIL;
>
> Instead of fixing the wrong handling of the return value, let's change
> it to use devm_ioremap_resource() which actually returns the expected
> ERR_PTR() and is preferred over request_and_ioremap().
>
Sure. I'll resend a v2.
regards,
dan carpenter
next prev parent reply other threads:[~2013-12-06 13:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-06 12:58 [patch] spi: bcm63xx-hsspi: checking for ERR_PTR instead of NULL Dan Carpenter
[not found] ` <20131206125823.GA32369-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
2013-12-06 13:08 ` Jonas Gorski
2013-12-06 13:34 ` Dan Carpenter [this message]
[not found] ` <CAOiHx=k87c_bFqFtJ7zJc9HxnjOEr2oMofNUsLkQbfQPrC04hQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-12-06 14:12 ` [patch v2] " Dan Carpenter
[not found] ` <20131206141212.GA956-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
2013-12-06 14:48 ` Jonas Gorski
2013-12-09 17:24 ` Mark Brown
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=20131206133430.GF28413@mwanda \
--to=dan.carpenter@oracle.com \
--cc=broonie@kernel.org \
--cc=jogo@openwrt.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-spi@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: 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).