Re: [PATCH 2/3] pwm: cros-ec: Simplify device tree xlation

From: Tzung-Bi Shih
Date: Wed Jun 12 2024 - 02:27:45 EST


On Fri, Jun 07, 2024 at 10:44:16AM +0200, Uwe Kleine-König wrote:
> The cros-ec device tree binding only uses #pwm-cells = <1>, and so there
> is no period provided in the device tree. Up to now this was handled by
> hardcoding the period to the only supported value in the custom xlate
> callback. Apart from that, the default xlate callback (i.e.
> of_pwm_xlate_with_flags()) handles this just fine (and better, e.g. by
> checking args->args_count >= 1 before accessing args->args[0]).
>
> To simplify make use of of_pwm_xlate_with_flags(), drop the custom
> callback and provide the default period in .probe() already.
>
> Apart from simplifying the driver this also drops the last non-core user
> of pwm_request_from_chip() and so makes further simplifications
> possible.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxx>

Reviewed-by: Tzung-Bi Shih <tzungbi@xxxxxxxxxx>