]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
pwm: atmel: Remove platform_device_id and use only dt bindings
authorKamel Bouhara <kamel.bouhara@bootlin.com>
Wed, 18 Sep 2019 14:57:16 +0000 (16:57 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Sat, 21 Sep 2019 01:25:10 +0000 (03:25 +0200)
Since commit 26202873bb51 ("avr32: remove support for AVR32
architecture") there is no more user of platform_device_id and we
should only use dt bindings

Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Acked-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/Kconfig
drivers/pwm/pwm-atmel.c

index 31dfc88ef36217ca871daf95126b061df48991c1..08f35e2b167e85be763744121264a33da062da62 100644 (file)
@@ -44,7 +44,7 @@ config PWM_AB8500
 
 config PWM_ATMEL
        tristate "Atmel PWM support"
-       depends on ARCH_AT91
+       depends on ARCH_AT91 && OF
        help
          Generic PWM framework driver for Atmel SoC.
 
index 53bc7b9b35818ce79359971a635fd17dc622c1ed..5b861da3e32598d7c267175623e834c2b858d37b 100644 (file)
@@ -318,19 +318,6 @@ static const struct atmel_pwm_data mchp_sam9x60_pwm_data = {
        },
 };
 
-static const struct platform_device_id atmel_pwm_devtypes[] = {
-       {
-               .name = "at91sam9rl-pwm",
-               .driver_data = (kernel_ulong_t)&atmel_sam9rl_pwm_data,
-       }, {
-               .name = "sama5d3-pwm",
-               .driver_data = (kernel_ulong_t)&atmel_sama5_pwm_data,
-       }, {
-               /* sentinel */
-       },
-};
-MODULE_DEVICE_TABLE(platform, atmel_pwm_devtypes);
-
 static const struct of_device_id atmel_pwm_dt_ids[] = {
        {
                .compatible = "atmel,at91sam9rl-pwm",
@@ -350,19 +337,6 @@ static const struct of_device_id atmel_pwm_dt_ids[] = {
 };
 MODULE_DEVICE_TABLE(of, atmel_pwm_dt_ids);
 
-static inline const struct atmel_pwm_data *
-atmel_pwm_get_driver_data(struct platform_device *pdev)
-{
-       const struct platform_device_id *id;
-
-       if (pdev->dev.of_node)
-               return of_device_get_match_data(&pdev->dev);
-
-       id = platform_get_device_id(pdev);
-
-       return (struct atmel_pwm_data *)id->driver_data;
-}
-
 static int atmel_pwm_probe(struct platform_device *pdev)
 {
        const struct atmel_pwm_data *data;
@@ -370,7 +344,7 @@ static int atmel_pwm_probe(struct platform_device *pdev)
        struct resource *res;
        int ret;
 
-       data = atmel_pwm_get_driver_data(pdev);
+       data = of_device_get_match_data(&pdev->dev);
        if (!data)
                return -ENODEV;
 
@@ -396,10 +370,8 @@ static int atmel_pwm_probe(struct platform_device *pdev)
        atmel_pwm->chip.dev = &pdev->dev;
        atmel_pwm->chip.ops = &atmel_pwm_ops;
 
-       if (pdev->dev.of_node) {
-               atmel_pwm->chip.of_xlate = of_pwm_xlate_with_flags;
-               atmel_pwm->chip.of_pwm_n_cells = 3;
-       }
+       atmel_pwm->chip.of_xlate = of_pwm_xlate_with_flags;
+       atmel_pwm->chip.of_pwm_n_cells = 3;
 
        atmel_pwm->chip.base = -1;
        atmel_pwm->chip.npwm = 4;
@@ -437,7 +409,6 @@ static struct platform_driver atmel_pwm_driver = {
                .name = "atmel-pwm",
                .of_match_table = of_match_ptr(atmel_pwm_dt_ids),
        },
-       .id_table = atmel_pwm_devtypes,
        .probe = atmel_pwm_probe,
        .remove = atmel_pwm_remove,
 };