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

Configure Feed

Select the types of activity you want to include in your feed.

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>

+12 -10
+5 -4
arch/sparc/kernel/pci_sabre.c
··· 13 13 #include <linux/export.h> 14 14 #include <linux/slab.h> 15 15 #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> 17 20 18 21 #include <asm/apb.h> 19 22 #include <asm/iommu.h> ··· 459 456 static const struct of_device_id sabre_match[]; 460 457 static int sabre_probe(struct platform_device *op) 461 458 { 462 - const struct of_device_id *match; 463 459 const struct linux_prom64_registers *pr_regs; 464 460 struct device_node *dp = op->dev.of_node; 465 461 struct pci_pbm_info *pbm; ··· 468 466 const u32 *vdma; 469 467 u64 clear_irq; 470 468 471 - match = of_match_device(sabre_match, &op->dev); 472 - hummingbird_p = match && (match->data != NULL); 469 + hummingbird_p = (uintptr_t)device_get_match_data(&op->dev); 473 470 if (!hummingbird_p) { 474 471 struct device_node *cpu_dp; 475 472
+7 -6
arch/sparc/kernel/pci_schizo.c
··· 11 11 #include <linux/slab.h> 12 12 #include <linux/export.h> 13 13 #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> 15 18 #include <linux/numa.h> 16 19 17 20 #include <asm/iommu.h> ··· 1462 1459 return err; 1463 1460 } 1464 1461 1465 - static const struct of_device_id schizo_match[]; 1466 1462 static int schizo_probe(struct platform_device *op) 1467 1463 { 1468 - const struct of_device_id *match; 1464 + unsigned long chip_type = (unsigned long)device_get_match_data(&op->dev); 1469 1465 1470 - match = of_match_device(schizo_match, &op->dev); 1471 - if (!match) 1466 + if (!chip_type) 1472 1467 return -EINVAL; 1473 - return __schizo_init(op, (unsigned long)match->data); 1468 + return __schizo_init(op, chip_type); 1474 1469 } 1475 1470 1476 1471 /* The ordering of this table is very important. Some Tomatillo