Re: [PATCH] pwm: lp3943: Dynamically allocate pwm chip base

From: Lokesh Vutla
Date: Mon Nov 02 2020 - 00:07:10 EST


Hi Uwe,

On 31/10/20 1:41 am, Uwe Kleine-König wrote:
> On Fri, Oct 30, 2020 at 07:11:35PM +0530, Lokesh Vutla wrote:
>> 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.
>>
>> Fixes: af66b3c0934e ("pwm: Add LP3943 PWM driver")
>> Signed-off-by: Lokesh Vutla <lokeshvutla@xxxxxx>
>
> Reviewed-by: Uwe Kleine-König <u.kleine-könig@xxxxxxxxxxxxxx>

Thanks.

>
> 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

>
> Best regards
> Uwe
>