Commit 61c2ef4b authored by Rob Herring's avatar Rob Herring

sparc: Use device_get_match_data()

Use preferred 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>
parent 9d1694dc
...@@ -13,7 +13,10 @@ ...@@ -13,7 +13,10 @@
#include <linux/export.h> #include <linux/export.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/of_device.h> #include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <asm/apb.h> #include <asm/apb.h>
#include <asm/iommu.h> #include <asm/iommu.h>
...@@ -456,7 +459,6 @@ static void sabre_pbm_init(struct pci_pbm_info *pbm, ...@@ -456,7 +459,6 @@ static void sabre_pbm_init(struct pci_pbm_info *pbm,
static const struct of_device_id sabre_match[]; static const struct of_device_id sabre_match[];
static int sabre_probe(struct platform_device *op) static int sabre_probe(struct platform_device *op)
{ {
const struct of_device_id *match;
const struct linux_prom64_registers *pr_regs; const struct linux_prom64_registers *pr_regs;
struct device_node *dp = op->dev.of_node; struct device_node *dp = op->dev.of_node;
struct pci_pbm_info *pbm; struct pci_pbm_info *pbm;
...@@ -466,8 +468,7 @@ static int sabre_probe(struct platform_device *op) ...@@ -466,8 +468,7 @@ static int sabre_probe(struct platform_device *op)
const u32 *vdma; const u32 *vdma;
u64 clear_irq; u64 clear_irq;
match = of_match_device(sabre_match, &op->dev); hummingbird_p = (uintptr_t)device_get_match_data(&op->dev);
hummingbird_p = match && (match->data != NULL);
if (!hummingbird_p) { if (!hummingbird_p) {
struct device_node *cpu_dp; struct device_node *cpu_dp;
......
...@@ -11,7 +11,10 @@ ...@@ -11,7 +11,10 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/export.h> #include <linux/export.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/of_device.h> #include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/numa.h> #include <linux/numa.h>
#include <asm/iommu.h> #include <asm/iommu.h>
...@@ -1459,15 +1462,13 @@ static int __schizo_init(struct platform_device *op, unsigned long chip_type) ...@@ -1459,15 +1462,13 @@ static int __schizo_init(struct platform_device *op, unsigned long chip_type)
return err; return err;
} }
static const struct of_device_id schizo_match[];
static int schizo_probe(struct platform_device *op) static int schizo_probe(struct platform_device *op)
{ {
const struct of_device_id *match; unsigned long chip_type = (unsigned long)device_get_match_data(&op->dev);
match = of_match_device(schizo_match, &op->dev); if (!chip_type)
if (!match)
return -EINVAL; return -EINVAL;
return __schizo_init(op, (unsigned long)match->data); return __schizo_init(op, chip_type);
} }
/* The ordering of this table is very important. Some Tomatillo /* The ordering of this table is very important. Some Tomatillo
......
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