ata: ahci_platform: Make code agnostic to OF/ACPI
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 9 Jun 2023 15:49:00 +0000 (18:49 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Jun 2023 11:34:31 +0000 (13:34 +0200)
With the help of a new device_is_compatible() make
the driver code agnostic to the OF/ACPI. This makes
it neater. As a side effect the header inclusions is
corrected (seems mod_devicetable.h was implicitly
included).

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Message-ID: <20230609154900.43024-4-andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/ata/ahci_platform.c

index 299ee686ac49a616d029f33503cc6840e00887bf..c18054333f7c968cc4e131545fc3127f03ac27e4 100644 (file)
@@ -9,14 +9,14 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/pm.h>
 #include <linux/device.h>
-#include <linux/of_device.h>
 #include <linux/platform_device.h>
+#include <linux/property.h>
 #include <linux/libata.h>
 #include <linux/ahci_platform.h>
-#include <linux/acpi.h>
 #include <linux/pci_ids.h>
 #include "ahci.h"
 
@@ -56,10 +56,10 @@ static int ahci_probe(struct platform_device *pdev)
        if (rc)
                return rc;
 
-       if (of_device_is_compatible(dev->of_node, "hisilicon,hisi-ahci"))
+       if (device_is_compatible(dev, "hisilicon,hisi-ahci"))
                hpriv->flags |= AHCI_HFLAG_NO_FBS | AHCI_HFLAG_NO_NCQ;
 
-       port = acpi_device_get_match_data(dev);
+       port = device_get_match_data(dev);
        if (!port)
                port = &ahci_port_info;