[PATCH v2 2/2] pinctrl: nuvoton: add NPCM8XX pinctrl and GPIO driver

Andy Shevchenko andy.shevchenko at gmail.com
Thu Jul 14 23:14:37 AEST 2022


On Thu, Jul 14, 2022 at 2:29 PM Krzysztof Kozlowski
<krzysztof.kozlowski at linaro.org> wrote:
> On 14/07/2022 14:23, Tomer Maimon wrote:

...

> > +static int npcm8xx_pinctrl_probe(struct platform_device *pdev)
> > +{

Temporary variable, i.e.

  struct device *dev = &pdev->dev;

> > +     struct npcm8xx_pinctrl *pctrl;
> > +     int ret;
> > +
> > +     pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL);
> > +     if (!pctrl)
> > +             return -ENOMEM;
> > +
> > +     pctrl->dev = &pdev->dev;
> > +     dev_set_drvdata(&pdev->dev, pctrl);
> > +
> > +     pctrl->gcr_regmap =
> > +             syscon_regmap_lookup_by_phandle(pctrl->dev->of_node, "nuvoton,sysgcr");
> > +     if (IS_ERR(pctrl->gcr_regmap))
> > +             return dev_err_probe(pctrl->dev, PTR_ERR(pctrl->gcr_regmap), "Failed to find nuvoton,sysgcr property\n");

Will help to shorten the above line(s).

> Please wrap your code according to Linux coding style - @80.

-- 
With Best Regards,
Andy Shevchenko


More information about the openbmc mailing list