ARM: s3c: Use pwm_get() in favour of pwm_request() in RX1950
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 26 Mar 2021 09:06:41 +0000 (10:06 +0100)
committerKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Thu, 1 Apr 2021 17:40:27 +0000 (19:40 +0200)
commit19f5027e0394d2f3e1766200b6bbde660f0b7848
tree9df6b39ec60ce9839cbf5733828fcb6453818c11
parentca881b97dbe1ce3ed94e20ae185b246435d86ead
ARM: s3c: Use pwm_get() in favour of pwm_request() in RX1950

pwm_request() is deprecated because (among others) it depends on a global
numbering of PWM devices. So register a pwm_lookup to pick the right PWM
device (identified by provider and its local id) and use pwm_get().

Before this patch the PWM #1 was used. This is provided by the
samsung-pwm device which is the only PWM provider on this machine. The
local offset is 1, see also commit c107fe904a10 ("ARM: S3C24XX: Use PWM
lookup table for mach-rx1950") with a similar conversion for PWM #0.

As a follow up specify the period only once and symmetrically use pwm_put()
instead of pwm_free() to drop the reference.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20210326090641.122436-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
arch/arm/mach-s3c/mach-rx1950.c