Skip to content

Commit 0ecbef3

Browse files
robherringdamien-lemoal
authored andcommitted
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>
1 parent 2267d5a commit 0ecbef3

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

drivers/ata/ahci_xgene.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
#include <linux/module.h>
1414
#include <linux/platform_device.h>
1515
#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>
1917
#include <linux/phy/phy.h>
2018
#include "ahci.h"
2119

@@ -735,7 +733,6 @@ static int xgene_ahci_probe(struct platform_device *pdev)
735733
struct ahci_host_priv *hpriv;
736734
struct xgene_ahci_context *ctx;
737735
struct resource *res;
738-
const struct of_device_id *of_devid;
739736
enum xgene_ahci_version version = XGENE_AHCI_V1;
740737
const struct ata_port_info *ppi[] = { &xgene_ahci_v1_port_info,
741738
&xgene_ahci_v2_port_info };
@@ -778,10 +775,8 @@ static int xgene_ahci_probe(struct platform_device *pdev)
778775
ctx->csr_mux = csr;
779776
}
780777

781-
of_devid = of_match_device(xgene_ahci_of_match, dev);
782-
if (of_devid) {
783-
if (of_devid->data)
784-
version = (unsigned long) of_devid->data;
778+
if (dev->of_node) {
779+
version = (enum xgene_ahci_version)of_device_get_match_data(dev);
785780
}
786781
#ifdef CONFIG_ACPI
787782
else {

0 commit comments

Comments
 (0)