Skip to content

Commit 61c2ef4

Browse files
committed
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: Rob Herring <robh@kernel.org>
1 parent 9d1694d commit 61c2ef4

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

arch/sparc/kernel/pci_sabre.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
#include <linux/export.h>
1414
#include <linux/slab.h>
1515
#include <linux/interrupt.h>
16-
#include <linux/of_device.h>
16+
#include <linux/of.h>
17+
#include <linux/of_platform.h>
18+
#include <linux/platform_device.h>
19+
#include <linux/property.h>
1720

1821
#include <asm/apb.h>
1922
#include <asm/iommu.h>
@@ -456,7 +459,6 @@ static void sabre_pbm_init(struct pci_pbm_info *pbm,
456459
static const struct of_device_id sabre_match[];
457460
static int sabre_probe(struct platform_device *op)
458461
{
459-
const struct of_device_id *match;
460462
const struct linux_prom64_registers *pr_regs;
461463
struct device_node *dp = op->dev.of_node;
462464
struct pci_pbm_info *pbm;
@@ -466,8 +468,7 @@ static int sabre_probe(struct platform_device *op)
466468
const u32 *vdma;
467469
u64 clear_irq;
468470

469-
match = of_match_device(sabre_match, &op->dev);
470-
hummingbird_p = match && (match->data != NULL);
471+
hummingbird_p = (uintptr_t)device_get_match_data(&op->dev);
471472
if (!hummingbird_p) {
472473
struct device_node *cpu_dp;
473474

arch/sparc/kernel/pci_schizo.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
#include <linux/slab.h>
1212
#include <linux/export.h>
1313
#include <linux/interrupt.h>
14-
#include <linux/of_device.h>
14+
#include <linux/of.h>
15+
#include <linux/of_platform.h>
16+
#include <linux/platform_device.h>
17+
#include <linux/property.h>
1518
#include <linux/numa.h>
1619

1720
#include <asm/iommu.h>
@@ -1459,15 +1462,13 @@ static int __schizo_init(struct platform_device *op, unsigned long chip_type)
14591462
return err;
14601463
}
14611464

1462-
static const struct of_device_id schizo_match[];
14631465
static int schizo_probe(struct platform_device *op)
14641466
{
1465-
const struct of_device_id *match;
1467+
unsigned long chip_type = (unsigned long)device_get_match_data(&op->dev);
14661468

1467-
match = of_match_device(schizo_match, &op->dev);
1468-
if (!match)
1469+
if (!chip_type)
14691470
return -EINVAL;
1470-
return __schizo_init(op, (unsigned long)match->data);
1471+
return __schizo_init(op, chip_type);
14711472
}
14721473

14731474
/* The ordering of this table is very important. Some Tomatillo

0 commit comments

Comments
 (0)