From: Tony Lindgren <tony@atomide.com>
To: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Jesper Nilsson <jespern@axis.com>,
Wei Yongjun <weiyj.lk@gmail.com>, Lars Persson <larper@axis.com>,
Niklas Cassel <niklass@axis.com>,
Wei Yongjun <weiyongjun1@huawei.com>,
linux-arm-kernel@axis.com,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Subject: Re: [PATCH -next v2] pinctrl: artpec6: Fix return value check in artpec6_pmx_probe()
Date: Fri, 28 Apr 2017 07:26:14 -0700 [thread overview]
Message-ID: <20170428142613.GI3777@atomide.com> (raw)
In-Reply-To: <20170428075814.GE10068@axis.com>
* Jesper Nilsson <jesper.nilsson@axis.com> [170428 01:01]:
> On Fri, Apr 28, 2017 at 09:43:07AM +0200, Linus Walleij wrote:
> > On Tue, Apr 25, 2017 at 3:40 PM, Jesper Nilsson <jesper.nilsson@axis.com> wrote:
> > > On Tue, Apr 25, 2017 at 11:29:30AM +0000, Wei Yongjun wrote:
> > >> From: Wei Yongjun <weiyongjun1@huawei.com>
> > >>
> > >> In case of error, the function pinctrl_register() returns
> > >> ERR_PTR() not NULL. The NULL test in the return value check
> > >> should be replaced with IS_ERR().
> > >>
> > >> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> > >
> > > Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
> > >
> > > Although I'm wondering if moving to pinctrl_register_and_init()
> > > would sense here. Linus?
> >
> > That depends, check on the commits introducing it for the
> > usecase.
> >
> > OTOMH it was introduced for when you have hogs in drivers
> > doing all set-up of groups and functions from the device tree.
>
> Yeah, so in this case it is not necessary, but
> the comment above pinctrl_register() explicitly says:
> "To avoid issues later on, please use the
> new pinctrl_register_and_init() below instead."
> Which to me indicates that it is recommended
> to use the pinctrl_register_and_init() in future code...
>
> > Tony?
If you want to use GENERIC_PINCTRL_GROUPS or GENERIC_PINMUX_FUNCTIONS
want or allocate pins dynamically in the driver, then init needs to be
updated. So yeah I'd use that style init for any new code.
Regards,
Tony
next prev parent reply other threads:[~2017-04-28 14:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-25 3:29 [PATCH -next] pinctrl: artpec6: Fix return value check in artpec6_pmx_probe() Wei Yongjun
2017-04-25 8:31 ` Jesper Nilsson
2017-04-25 9:18 ` weiyongjun (A)
2017-04-25 11:29 ` [PATCH -next v2] " Wei Yongjun
2017-04-25 13:40 ` Jesper Nilsson
2017-04-28 7:43 ` Linus Walleij
2017-04-28 7:58 ` Jesper Nilsson
2017-04-28 14:26 ` Tony Lindgren [this message]
2017-04-28 7:41 ` Linus Walleij
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=20170428142613.GI3777@atomide.com \
--to=tony@atomide.com \
--cc=jesper.nilsson@axis.com \
--cc=jespern@axis.com \
--cc=larper@axis.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@axis.com \
--cc=linux-gpio@vger.kernel.org \
--cc=niklass@axis.com \
--cc=weiyj.lk@gmail.com \
--cc=weiyongjun1@huawei.com \
/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 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.