[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vcky+1jcjAtQ+RwcnK6TjWrsK8UMSa7hO3wmDL0Eb6beQ@mail.gmail.com>
Date: Thu, 10 Nov 2022 12:03:35 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Hans de Goede <hdegoede@...hat.com>,
Thierry Reding <thierry.reding@...il.com>,
linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-pwm@...r.kernel.org, Andy Shevchenko <andy@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>
Subject: Re: [PATCH v2 6/6] pinctrl: intel: Enumerate PWM device when
community has a capabilitty
On Thu, Nov 10, 2022 at 9:45 AM Uwe Kleine-König
<u.kleine-koenig@...gutronix.de> wrote:
> On Tue, Nov 08, 2022 at 04:22:26PM +0200, Andy Shevchenko wrote:
> > Some of the Communities may have PWM capability. In such cases,
> > enumerate PWM device via respective driver. User is still responsible
> > for setting correct pin muxing for the line that needs to output the
> > signal.
...
> > + pwm = pwm_lpss_probe(pctrl->dev, community->regs + PWMC, &info);
> > + if (IS_ERR(pwm) && PTR_ERR(pwm) != -ENODEV)
> > + return PTR_ERR(pwm);
>
> Linus and Andy already agreed that this patch is ugly. I wonder if this
> here would be a bit less ugly if you do:
>
> if (IS_REACHABLE(...)) {
> pwm = pwm_lpss_probe(...);
> ...
>
>
> }
>
> and drop the check PTR_ERR(pwm) != -ENODEV (which might have a different
> semantic than "the pwm driver isn't available").
I will think about it (in such case the comment against the previous
patch makes more sense to me).
Thank you for the review!
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists