lkml.org 
[lkml]   [2022]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v1 1/2] pinctrl: intel: Use temporary variable for struct device
On Thu, Nov 3, 2022 at 9:26 AM Mika Westerberg
<mika.westerberg@linux.intel.com> wrote:
> On Wed, Nov 02, 2022 at 05:29:14PM +0200, Andy Shevchenko wrote:
> > Use temporary variable for struct device to make code neater.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> > drivers/pinctrl/intel/pinctrl-intel.c | 23 ++++++++++++-----------
> > 1 file changed, 12 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c
> > index fe5bf2184cbf..e15629348cb5 100644
> > --- a/drivers/pinctrl/intel/pinctrl-intel.c
> > +++ b/drivers/pinctrl/intel/pinctrl-intel.c
> > @@ -1522,14 +1522,15 @@ static int intel_pinctrl_probe_pwm(struct intel_pinctrl *pctrl,
> > int intel_pinctrl_probe(struct platform_device *pdev,
> > const struct intel_pinctrl_soc_data *soc_data)
> > {
> > + struct device *dev = &pdev->dev;
> > struct intel_pinctrl *pctrl;
> > int i, ret, irq;
> >
> > - pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL);
> > + pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL);
>
> IMHO &pdev->dev is neater and saves an extra line. I would agree if this
> would be something like &foo->bar->baz->dev but it is not.

I have no strong opinion, but one thing which may play in favour of
the patches is that all other drivers, that have their custom
->probe() implemented, are using temporary variable. That said, let's
consider this as unification among Intel pin control drivers.

> Anyway, no feelings about this so feel free to add,
>
> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
>
> for both patches.

Thank you!

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2022-11-03 11:56    [W:0.042 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site