Re: [PATCH v4 05/11] pwm: add support for sl28cpld PWM controller

2020-06-08 Thread Lee Jones
On Fri, 05 Jun 2020, Michael Walle wrote: > Am 2020-06-05 10:49, schrieb Lee Jones: > [..] > > > +static inline struct sl28cpld_pwm *to_sl28cpld_pwm(struct pwm_chip > > > *chip) > > > +{ > > > + return container_of(chip, struct sl28cpld_pwm, pwm_chip); > > > +} > > > > Why not save yourself the t

Re: [PATCH v4 05/11] pwm: add support for sl28cpld PWM controller

2020-06-05 Thread Michael Walle
Am 2020-06-05 10:49, schrieb Lee Jones: [..] +static inline struct sl28cpld_pwm *to_sl28cpld_pwm(struct pwm_chip *chip) +{ + return container_of(chip, struct sl28cpld_pwm, pwm_chip); +} Why not save yourself the trouble and just: struct sl28cpld_pwm *pwm = dev_get_drvdata(chip->dev);

Re: [PATCH v4 05/11] pwm: add support for sl28cpld PWM controller

2020-06-05 Thread Michael Walle
Am 2020-06-05 10:49, schrieb Lee Jones: On Thu, 04 Jun 2020, Michael Walle wrote: Add support for the PWM controller of the sl28cpld board management controller. This is part of a multi-function device driver. The controller has one PWM channel and can just generate four distinct frequencies.

Re: [PATCH v4 05/11] pwm: add support for sl28cpld PWM controller

2020-06-05 Thread Andy Shevchenko
On Fri, Jun 5, 2020 at 11:51 AM Lee Jones wrote: > On Thu, 04 Jun 2020, Michael Walle wrote: ... > > + cycle = state->duty_cycle * config->max_duty_cycle; > > + do_div(cycle, state->period); > > Forgive my ignorance (I'm new here!), but what are these 2 lines > doing? Here we are multip

Re: [PATCH v4 05/11] pwm: add support for sl28cpld PWM controller

2020-06-05 Thread Lee Jones
On Thu, 04 Jun 2020, Michael Walle wrote: > Add support for the PWM controller of the sl28cpld board management > controller. This is part of a multi-function device driver. > > The controller has one PWM channel and can just generate four distinct > frequencies. > > Signed-off-by: Michael Walle

Re: [PATCH v4 05/11] pwm: add support for sl28cpld PWM controller

2020-06-05 Thread Andy Shevchenko
On Fri, Jun 5, 2020 at 12:16 AM Michael Walle wrote: > > Add support for the PWM controller of the sl28cpld board management > controller. This is part of a multi-function device driver. > > The controller has one PWM channel and can just generate four distinct > frequencies. So same comments (ex

[PATCH v4 05/11] pwm: add support for sl28cpld PWM controller

2020-06-04 Thread Michael Walle
Add support for the PWM controller of the sl28cpld board management controller. This is part of a multi-function device driver. The controller has one PWM channel and can just generate four distinct frequencies. Signed-off-by: Michael Walle --- drivers/pwm/Kconfig| 10 ++ drivers/pwm/M