pwm: lpss: Use device_get_match_data() to get device data
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 27 Sep 2022 16:24:18 +0000 (19:24 +0300)
committerThierry Reding <thierry.reding@gmail.com>
Wed, 28 Sep 2022 14:18:11 +0000 (16:18 +0200)
device_get_match_data() in ACPI case calls similar to the
acpi_match_device(). We may simplify the code and make it
generic by replacing the latter with the former.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-lpss-platform.c

index 7bbbb7a9b5785cfabaaaf202e984180a8b9ecbe8..c48c6f2b2cd8f441ccc01e57e1ee32ff6abd0b46 100644 (file)
@@ -7,11 +7,12 @@
  * Derived from the original pwm-lpss.c
  */
 
-#include <linux/acpi.h>
 #include <linux/kernel.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
+#include <linux/property.h>
 
 #include "pwm-lpss.h"
 
 static int pwm_lpss_probe_platform(struct platform_device *pdev)
 {
        const struct pwm_lpss_boardinfo *info;
-       const struct acpi_device_id *id;
        struct pwm_lpss_chip *lpwm;
        void __iomem *base;
 
-       id = acpi_match_device(pdev->dev.driver->acpi_match_table, &pdev->dev);
-       if (!id)
+       info = device_get_match_data(&pdev->dev);
+       if (!info)
                return -ENODEV;
 
-       info = (const struct pwm_lpss_boardinfo *)id->driver_data;
-
        base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(base))
                return PTR_ERR(base);