pwm: cros-ec: Simplify device tree xlation
authorUwe Kleine-König <ukleinek@baylibre.com>
Fri, 7 Jun 2024 08:44:16 +0000 (10:44 +0200)
committerUwe Kleine-König <ukleinek@kernel.org>
Wed, 10 Jul 2024 15:52:47 +0000 (17:52 +0200)
commit40571a5b3b73c6c5189e55ff82b97a58bec371a1
treeee13aa509c6ab343a6275603f83fa90d4ef0af1d
parentf7d5463e2a8f1fef855af2b62a1f7b59b830ad05
pwm: cros-ec: Simplify device tree xlation

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@baylibre.com>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20240607084416.897777-7-u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
drivers/pwm/pwm-cros-ec.c