Re: [PATCH -next v2] pinctrl: artpec6: Fix return value check in artpec6_pmx_probe()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Jesper Nilsson <jesper.nilsson@xxxxxxxx> [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@xxxxxxxx> wrote:
> > > On Tue, Apr 25, 2017 at 11:29:30AM +0000, Wei Yongjun wrote:
> > >> From: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
> > >>
> > >> 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@xxxxxxxxxx>
> > >
> > > Acked-by: Jesper Nilsson <jesper.nilsson@xxxxxxxx>
> > >
> > > 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
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux