pwm: ab8500: Explicitly allocate pwm chip base dynamically
authorUwe Kleine-König <uwe@kleine-koenig.org>
Fri, 6 Nov 2020 17:15:47 +0000 (18:15 +0100)
committerThierry Reding <thierry.reding@gmail.com>
Thu, 17 Dec 2020 13:18:48 +0000 (14:18 +0100)
The ab8500 driver is the last one which doesn't (explicitly) use dynamic
allocation of the pwm id. Looking through the kernel sources I didn't
find a place that relies on this id. And with the device probed from
device tree pdev->id is -1 anyhow; making this explicit looks
beneficial, too.

Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-ab8500.c

index 4b6f9e24e11d414ae6e5d32b5b8daab230ab22d0..58c6c0f5b0ec6dff3b885d1ef5e971f973fcbde6 100644 (file)
@@ -101,7 +101,7 @@ static int ab8500_pwm_probe(struct platform_device *pdev)
 
        ab8500->chip.dev = &pdev->dev;
        ab8500->chip.ops = &ab8500_pwm_ops;
-       ab8500->chip.base = pdev->id;
+       ab8500->chip.base = -1;
        ab8500->chip.npwm = 1;
 
        err = pwmchip_add(&ab8500->chip);