Skip to content

Commit ba52464

Browse files
committed
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>
1 parent 07e461c commit ba52464

3 files changed

Lines changed: 3 additions & 31 deletions

File tree

‎arch/powerpc/include/asm/dcr-mmio.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ static inline void dcr_write_mmio(dcr_host_mmio_t host,
5151
out_be32(host.token + ((host.base + dcr_n) * host.stride), value);
5252
}
5353

54-
extern u64 of_translate_dcr_address(struct device_node *dev,
55-
unsigned int dcr_n,
56-
unsigned int *stride);
57-
5854
#endif /* __KERNEL__ */
5955
#endif /* _ASM_POWERPC_DCR_MMIO_H */
6056

‎arch/powerpc/sysdev/dcr.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ EXPORT_SYMBOL_GPL(dcr_resource_len);
152152

153153
#ifdef CONFIG_PPC_DCR_MMIO
154154

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)
158158
{
159159
struct device_node *dp;
160160
const u32 *p;

‎drivers/of/platform.c‎

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ struct platform_device *of_find_device_by_node(struct device_node *np)
5151
}
5252
EXPORT_SYMBOL(of_find_device_by_node);
5353

54-
#if defined(CONFIG_PPC_DCR)
55-
#include <asm/dcr.h>
56-
#endif
57-
5854
#ifdef CONFIG_OF_ADDRESS
5955
/*
6056
* The following routines scan a subtree and registers a device for
@@ -78,26 +74,6 @@ void of_device_make_bus_id(struct device *dev)
7874
const __be32 *reg;
7975
u64 addr;
8076

81-
#ifdef CONFIG_PPC_DCR
82-
/*
83-
* If it's a DCR based device, use 'd' for native DCRs
84-
* and 'D' for MMIO DCRs.
85-
*/
86-
reg = of_get_property(node, "dcr-reg", NULL);
87-
if (reg) {
88-
#ifdef CONFIG_PPC_DCR_NATIVE
89-
dev_set_name(dev, "d%x.%s", *reg, node->name);
90-
#else /* CONFIG_PPC_DCR_NATIVE */
91-
u64 addr = of_translate_dcr_address(node, *reg, NULL);
92-
if (addr != OF_BAD_ADDR) {
93-
dev_set_name(dev, "D%llx.%s",
94-
(unsigned long long)addr, node->name);
95-
return;
96-
}
97-
#endif /* !CONFIG_PPC_DCR_NATIVE */
98-
}
99-
#endif /* CONFIG_PPC_DCR */
100-
10177
/* Construct the name, using parent nodes if necessary to ensure uniqueness */
10278
while (node->parent) {
10379
/*

0 commit comments

Comments
 (0)