]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pwm: lp3943: Dynamically allocate PWM chip base
authorLokesh Vutla <lokeshvutla@ti.com>
Fri, 30 Oct 2020 13:41:35 +0000 (19:11 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Dec 2020 12:47:03 +0000 (13:47 +0100)
commite514cfc38f53a2c72940999d1e8ef1d002e6dfed
treef26686969b0732497d91a4730c33c6acd75918fc
parent1bac99796304584cf17766323c3b52c091fe46fb
pwm: lp3943: Dynamically allocate PWM chip base

[ Upstream commit 1f0f1e80fdd3aa9631f6c22cda4f8550cfcfcc3e ]

When there are other PWM controllers enabled along with pwm-lp3943,
pwm-lp3942 is failing to probe with -EEXIST error. This is because
other PWM controllers are probed first and assigned PWM base 0 and
pwm-lp3943 is requesting for 0 again.

In order to avoid this, assign the chip base with -1, so that it is
dynamically allocated.

Fixes: af66b3c0934e ("pwm: Add LP3943 PWM driver")
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Uwe Kleine-König <u.kleine-könig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pwm/pwm-lp3943.c