diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2024-01-19 13:00:45 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2024-01-19 13:00:45 -0800 |
commit | 9bc44c51a0461e099d4eb5dff86c2d72f0fb4a6c (patch) | |
tree | 3379df41c7fa335ce1a48b4af2276f122253b4e3 /arch | |
parent | a638bfbfa1f8e8fbf36d84679916c60c1382a2ef (diff) | |
parent | ef175b29a242fea98f467f008237484b03c94834 (diff) | |
download | lwn-9bc44c51a0461e099d4eb5dff86c2d72f0fb4a6c.tar.gz lwn-9bc44c51a0461e099d4eb5dff86c2d72f0fb4a6c.zip |
Merge tag 'devicetree-for-6.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull devicetree header detangling from Rob Herring:
"Remove the circular including of of_device.h and of_platform.h along
with all of their implicit includes.
This is the culmination of several kernel cycles worth of fixing
implicit DT includes throughout the tree"
* tag 'devicetree-for-6.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
of: Stop circularly including of_device.h and of_platform.h
clk: qcom: gcc-x1e80100: Replace of_device.h with explicit includes
thermal: loongson2: Replace of_device.h with explicit includes
net: can: Use device_get_match_data()
sparc: Use device_get_match_data()
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sparc/kernel/pci_sabre.c | 9 | ||||
-rw-r--r-- | arch/sparc/kernel/pci_schizo.c | 13 |
2 files changed, 12 insertions, 10 deletions
diff --git a/arch/sparc/kernel/pci_sabre.c b/arch/sparc/kernel/pci_sabre.c index 3c38ca40a22b..a84598568300 100644 --- a/arch/sparc/kernel/pci_sabre.c +++ b/arch/sparc/kernel/pci_sabre.c @@ -13,7 +13,10 @@ #include <linux/export.h> #include <linux/slab.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/iommu.h> @@ -456,7 +459,6 @@ static void sabre_pbm_init(struct pci_pbm_info *pbm, static const struct of_device_id sabre_match[]; static int sabre_probe(struct platform_device *op) { - const struct of_device_id *match; const struct linux_prom64_registers *pr_regs; struct device_node *dp = op->dev.of_node; struct pci_pbm_info *pbm; @@ -466,8 +468,7 @@ static int sabre_probe(struct platform_device *op) const u32 *vdma; u64 clear_irq; - match = of_match_device(sabre_match, &op->dev); - hummingbird_p = match && (match->data != NULL); + hummingbird_p = (uintptr_t)device_get_match_data(&op->dev); if (!hummingbird_p) { struct device_node *cpu_dp; diff --git a/arch/sparc/kernel/pci_schizo.c b/arch/sparc/kernel/pci_schizo.c index 23b47f7fdb1d..5d8dd4949586 100644 --- a/arch/sparc/kernel/pci_schizo.c +++ b/arch/sparc/kernel/pci_schizo.c @@ -11,7 +11,10 @@ #include <linux/slab.h> #include <linux/export.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 <asm/iommu.h> @@ -1459,15 +1462,13 @@ out_err: return err; } -static const struct of_device_id schizo_match[]; 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 (!match) + if (!chip_type) 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 |