lkml.org 
[lkml]   [2013]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH 08/33] gpio: Convert to devm_ioremap_resource()
    Date
    On Mon, 21 Jan 2013 16:22:21 +0530, Viresh Kumar <viresh.kumar@linaro.org> wrote:
    > On Mon, Jan 21, 2013 at 3:39 PM, Thierry Reding
    > <thierry.reding@avionic-design.de> wrote:
    > > diff --git a/drivers/gpio/gpio-spear-spics.c b/drivers/gpio/gpio-spear-spics.c
    > > index 5f45fc4..7a4bf7c 100644
    > > --- a/drivers/gpio/gpio-spear-spics.c
    > > +++ b/drivers/gpio/gpio-spear-spics.c
    > > @@ -140,11 +140,9 @@ static int spics_gpio_probe(struct platform_device *pdev)
    > > return -ENOMEM;
    > > }
    > >
    > > - spics->base = devm_request_and_ioremap(&pdev->dev, res);
    > > - if (!spics->base) {
    > > - dev_err(&pdev->dev, "request and ioremap fail\n");
    >
    > can we keep it as is?

    And this is why I dislike the ERR_PTR pattern so much. It goes against
    every instinct about what is and is not a valid pointer.

    I know people want error codes, but I think hoping that all users will
    remember to do 'if (IS_ERR(ptr))' instead of 'if (!ptr)' makes things
    worse not better.

    g.



    \
     
     \ /
      Last update: 2013-02-09 15:21    [W:4.316 / U:0.208 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site