On Fri, Dec 06, 2013 at 02:08:08PM +0100, Jonas Gorski wrote:
> On Fri, Dec 6, 2013 at 1:58 PM, Dan Carpenter <[email protected]> 
> 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 <[email protected]>
> >
> > 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

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to