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

ata: xgene: Use of_device_get_match_data()

Use preferred of_device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>

authored by

Rob Herring and committed by
Damien Le Moal
0ecbef31 2267d5a1

+3 -8
+3 -8
drivers/ata/ahci_xgene.c
··· 13 13 #include <linux/module.h> 14 14 #include <linux/platform_device.h> 15 15 #include <linux/ahci_platform.h> 16 - #include <linux/of_address.h> 17 - #include <linux/of_device.h> 18 - #include <linux/of_irq.h> 16 + #include <linux/of.h> 19 17 #include <linux/phy/phy.h> 20 18 #include "ahci.h" 21 19 ··· 733 735 struct ahci_host_priv *hpriv; 734 736 struct xgene_ahci_context *ctx; 735 737 struct resource *res; 736 - const struct of_device_id *of_devid; 737 738 enum xgene_ahci_version version = XGENE_AHCI_V1; 738 739 const struct ata_port_info *ppi[] = { &xgene_ahci_v1_port_info, 739 740 &xgene_ahci_v2_port_info }; ··· 775 778 ctx->csr_mux = csr; 776 779 } 777 780 778 - of_devid = of_match_device(xgene_ahci_of_match, dev); 779 - if (of_devid) { 780 - if (of_devid->data) 781 - version = (unsigned long) of_devid->data; 781 + if (dev->of_node) { 782 + version = (enum xgene_ahci_version)of_device_get_match_data(dev); 782 783 } 783 784 #ifdef CONFIG_ACPI 784 785 else {