staging: greybus: pwm: Rework how the number of PWM lines is determined
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Wed, 14 Feb 2024 09:33:26 +0000 (10:33 +0100)
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 22 Feb 2024 13:39:29 +0000 (14:39 +0100)
commite0d32775716508942657cc5778bd881b40659287
treef62df74cdd370bd730c85750ce76104c157f8174
parent1dd173fc96244d4b67f642cf90c29f21aa2b49b9
staging: greybus: pwm: Rework how the number of PWM lines is determined

With a later patch it becomes necessary to already now the number of PWM
lines when pwmc is allocated. So make the function not use pwmc but a
plain connection and return the number of lines instead of storing it in
pwmc. This allows to get rid of the pwm_max member.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/3efd84ac03e7dc288f20b0de20b142b6404cb1fa.1707900770.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
drivers/staging/greybus/pwm.c