Commit 0ecbef31 authored by Rob Herring's avatar Rob Herring Committed by Damien Le Moal

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: default avatarRob Herring <robh@kernel.org>
Reviewed-by: default avatarNiklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: default avatarDamien Le Moal <dlemoal@kernel.org>
parent 2267d5a1
...@@ -13,9 +13,7 @@ ...@@ -13,9 +13,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/ahci_platform.h> #include <linux/ahci_platform.h>
#include <linux/of_address.h> #include <linux/of.h>
#include <linux/of_device.h>
#include <linux/of_irq.h>
#include <linux/phy/phy.h> #include <linux/phy/phy.h>
#include "ahci.h" #include "ahci.h"
...@@ -735,7 +733,6 @@ static int xgene_ahci_probe(struct platform_device *pdev) ...@@ -735,7 +733,6 @@ static int xgene_ahci_probe(struct platform_device *pdev)
struct ahci_host_priv *hpriv; struct ahci_host_priv *hpriv;
struct xgene_ahci_context *ctx; struct xgene_ahci_context *ctx;
struct resource *res; struct resource *res;
const struct of_device_id *of_devid;
enum xgene_ahci_version version = XGENE_AHCI_V1; enum xgene_ahci_version version = XGENE_AHCI_V1;
const struct ata_port_info *ppi[] = { &xgene_ahci_v1_port_info, const struct ata_port_info *ppi[] = { &xgene_ahci_v1_port_info,
&xgene_ahci_v2_port_info }; &xgene_ahci_v2_port_info };
...@@ -778,10 +775,8 @@ static int xgene_ahci_probe(struct platform_device *pdev) ...@@ -778,10 +775,8 @@ static int xgene_ahci_probe(struct platform_device *pdev)
ctx->csr_mux = csr; ctx->csr_mux = csr;
} }
of_devid = of_match_device(xgene_ahci_of_match, dev); if (dev->of_node) {
if (of_devid) { version = (enum xgene_ahci_version)of_device_get_match_data(dev);
if (of_devid->data)
version = (unsigned long) of_devid->data;
} }
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
else { else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment