pwm: Autodetect default value for of_pwm_n_cells from device tree
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 10 May 2021 14:06:39 +0000 (16:06 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Tue, 25 May 2021 16:18:25 +0000 (18:18 +0200)
commit69230cfac3d02c1b8d78aa7bdb29a1710147d49b
tree942a8aa1913822a1c78ea7c9502f8af1c9f39eb1
parent5447e7833629ee4208b7d41862ab0249d6b50077
pwm: Autodetect default value for of_pwm_n_cells from device tree

This allows to simplify all drivers that use three pwm-cells.
The only ugly side effect is that if a driver specified of_pwm_n_cells = 2
it suddenly supports device trees that use #pwm-cells = <3>. This however
isn't a bad thing because the driver doesn't need explicit support for
three cells as the core handles all the details. Also there is no such
in-tree driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/core.c