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

of: Stop naming platform_device using dcr address

There is now a way to ensure all platform devices get a unique name when
populated from the device tree, and the DCR_NATIVE code path is broken
anyway. PowerPC Cell (PS3) is the only platform that actually uses this
path. Most likely nobody will notice if it is killed. Remove the code
and associated ugly #ifdef.

The user-visible impact of this patch is that any DCR device on Cell
will get a new name in the /sys/devices hierarchy.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>

+3 -31
-4
arch/powerpc/include/asm/dcr-mmio.h
··· 51 51 out_be32(host.token + ((host.base + dcr_n) * host.stride), value); 52 52 } 53 53 54 - extern u64 of_translate_dcr_address(struct device_node *dev, 55 - unsigned int dcr_n, 56 - unsigned int *stride); 57 - 58 54 #endif /* __KERNEL__ */ 59 55 #endif /* _ASM_POWERPC_DCR_MMIO_H */ 60 56
+3 -3
arch/powerpc/sysdev/dcr.c
··· 152 152 153 153 #ifdef CONFIG_PPC_DCR_MMIO 154 154 155 - u64 of_translate_dcr_address(struct device_node *dev, 156 - unsigned int dcr_n, 157 - unsigned int *out_stride) 155 + static u64 of_translate_dcr_address(struct device_node *dev, 156 + unsigned int dcr_n, 157 + unsigned int *out_stride) 158 158 { 159 159 struct device_node *dp; 160 160 const u32 *p;
-24
drivers/of/platform.c
··· 51 51 } 52 52 EXPORT_SYMBOL(of_find_device_by_node); 53 53 54 - #if defined(CONFIG_PPC_DCR) 55 - #include <asm/dcr.h> 56 - #endif 57 - 58 54 #ifdef CONFIG_OF_ADDRESS 59 55 /* 60 56 * The following routines scan a subtree and registers a device for ··· 73 77 struct device_node *node = dev->of_node; 74 78 const __be32 *reg; 75 79 u64 addr; 76 - 77 - #ifdef CONFIG_PPC_DCR 78 - /* 79 - * If it's a DCR based device, use 'd' for native DCRs 80 - * and 'D' for MMIO DCRs. 81 - */ 82 - reg = of_get_property(node, "dcr-reg", NULL); 83 - if (reg) { 84 - #ifdef CONFIG_PPC_DCR_NATIVE 85 - dev_set_name(dev, "d%x.%s", *reg, node->name); 86 - #else /* CONFIG_PPC_DCR_NATIVE */ 87 - u64 addr = of_translate_dcr_address(node, *reg, NULL); 88 - if (addr != OF_BAD_ADDR) { 89 - dev_set_name(dev, "D%llx.%s", 90 - (unsigned long long)addr, node->name); 91 - return; 92 - } 93 - #endif /* !CONFIG_PPC_DCR_NATIVE */ 94 - } 95 - #endif /* CONFIG_PPC_DCR */ 96 80 97 81 /* Construct the name, using parent nodes if necessary to ensure uniqueness */ 98 82 while (node->parent) {