Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ata: ahci_platform: Make code agnostic to OF/ACPI

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>

authored by

Andy Shevchenko and committed by
Greg Kroah-Hartman
259b8366 2de5897b

+4 -4
+4 -4
drivers/ata/ahci_platform.c
··· 9 9 */ 10 10 11 11 #include <linux/kernel.h> 12 + #include <linux/mod_devicetable.h> 12 13 #include <linux/module.h> 13 14 #include <linux/pm.h> 14 15 #include <linux/device.h> 15 - #include <linux/of_device.h> 16 16 #include <linux/platform_device.h> 17 + #include <linux/property.h> 17 18 #include <linux/libata.h> 18 19 #include <linux/ahci_platform.h> 19 - #include <linux/acpi.h> 20 20 #include <linux/pci_ids.h> 21 21 #include "ahci.h" 22 22 ··· 56 56 if (rc) 57 57 return rc; 58 58 59 - if (of_device_is_compatible(dev->of_node, "hisilicon,hisi-ahci")) 59 + if (device_is_compatible(dev, "hisilicon,hisi-ahci")) 60 60 hpriv->flags |= AHCI_HFLAG_NO_FBS | AHCI_HFLAG_NO_NCQ; 61 61 62 - port = acpi_device_get_match_data(dev); 62 + port = device_get_match_data(dev); 63 63 if (!port) 64 64 port = &ahci_port_info; 65 65