pwm: lp3943: Dynamically allocate pwm chip base
PATCH 1/1 pwm: lp3943: Dynamically allocate pwm chip base
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 controller is probed first and assigned pwmchip 0 and pwm-lp3943 is requesting for 0 again. In order to avoid this, assign the chip base with -1, so that id is dynamically allocated.
--- drivers/pwm/pwm-lp3943.c | 1 + 1 file changed, 1 insertion(+)
drivers/pwm/pwm-lp3943.c +1 -0
@@ -275,6 +275,7 @@ static int lp3943_pwm_probe(struct platform_device *pdev) lp3943_pwm->chip.dev = &pdev->dev; lp3943_pwm->chip.ops = &lp3943_pwm_ops; lp3943_pwm->chip.npwm =LP3943_NUM_PWMS ; + lp3943_pwm->chip.base =-1 ;platform_set_drvdata (pdev, lp3943_pwm);
Signature · 1 line
2.28.0
Quoted 8 lines · Lokesh Vutla
When there are other pwm controllers enabled along with pwm-lp3943, pwm-lp3942 is failing to probe with
-EEXISTerror. This is because other pwm controller is probed first and assigned pwmchip 0 and pwm-lp3943 is requesting for 0 again. In order to avoid this, assign the chip base with -1, so that id is dynamically allocated.Fixes af66b3c0934e ("pwm: Add LP3943 PWM driver")Signed-off-by Lokesh Vutla <[email protected]>
With this patch applied only the pwm-ab8500 driver is left not using -1 for base.
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ |
Hi Uwe,
Quoted 11 lines · Uwe Kleine-König
Quoted 8 lines · Lokesh Vutla
When there are other pwm controllers enabled along with pwm-lp3943, pwm-lp3942 is failing to probe with
-EEXISTerror. This is because other pwm controller is probed first and assigned pwmchip 0 and pwm-lp3943 is requesting for 0 again. In order to avoid this, assign the chip base with -1, so that id is dynamically allocated.Fixes af66b3c0934e ("pwm: Add LP3943 PWM driver")Signed-off-by Lokesh Vutla <[email protected]>Reviewed-by Uwe Kleine-König <u.kleine-kö[email protected]>
Thanks.
Quoted 3 lines
With this patch applied only the pwm-ab8500 driver is left not using -1 for base.
pwm-ab8500 is assigning ab8500->chip.base as pdev->id. At least in the DT case pdev->id is always -1(as of today). So, base is being allocated dynamically in case of DT.
Thanks and regards,
Lokesh
Quoted 4 lines
Best regards
Uwe
Thierry Reding
AppliedQuoted 11 lines · Lokesh Vutla
When there are other pwm controllers enabled along with pwm-lp3943, pwm-lp3942 is failing to probe with
-EEXISTerror. This is because other pwm controller is probed first and assigned pwmchip 0 and pwm-lp3943 is requesting for 0 again. In order to avoid this, assign the chip base with -1, so that id is dynamically allocated.Fixes af66b3c0934e ("pwm: Add LP3943 PWM driver")Signed-off-by Lokesh Vutla <[email protected]>--- drivers/pwm/pwm-lp3943.c | 1 + 1 file changed, 1 insertion(+)
Applied, thanks.
Thierry