Skip to content

Commit

Permalink
of: Stop naming platform_device using dcr address
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Grant Likely committed May 22, 2014
1 parent 07e461c commit ba52464
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 31 deletions.
4 changes: 0 additions & 4 deletions arch/powerpc/include/asm/dcr-mmio.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ static inline void dcr_write_mmio(dcr_host_mmio_t host,
out_be32(host.token + ((host.base + dcr_n) * host.stride), value);
}

extern u64 of_translate_dcr_address(struct device_node *dev,
unsigned int dcr_n,
unsigned int *stride);

#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_DCR_MMIO_H */

Expand Down
6 changes: 3 additions & 3 deletions arch/powerpc/sysdev/dcr.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ EXPORT_SYMBOL_GPL(dcr_resource_len);

#ifdef CONFIG_PPC_DCR_MMIO

u64 of_translate_dcr_address(struct device_node *dev,
unsigned int dcr_n,
unsigned int *out_stride)
static u64 of_translate_dcr_address(struct device_node *dev,
unsigned int dcr_n,
unsigned int *out_stride)
{
struct device_node *dp;
const u32 *p;
Expand Down
24 changes: 0 additions & 24 deletions drivers/of/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ struct platform_device *of_find_device_by_node(struct device_node *np)
}
EXPORT_SYMBOL(of_find_device_by_node);

#if defined(CONFIG_PPC_DCR)
#include <asm/dcr.h>
#endif

#ifdef CONFIG_OF_ADDRESS
/*
* The following routines scan a subtree and registers a device for
Expand All @@ -78,26 +74,6 @@ void of_device_make_bus_id(struct device *dev)
const __be32 *reg;
u64 addr;

#ifdef CONFIG_PPC_DCR
/*
* If it's a DCR based device, use 'd' for native DCRs
* and 'D' for MMIO DCRs.
*/
reg = of_get_property(node, "dcr-reg", NULL);
if (reg) {
#ifdef CONFIG_PPC_DCR_NATIVE
dev_set_name(dev, "d%x.%s", *reg, node->name);
#else /* CONFIG_PPC_DCR_NATIVE */
u64 addr = of_translate_dcr_address(node, *reg, NULL);
if (addr != OF_BAD_ADDR) {
dev_set_name(dev, "D%llx.%s",
(unsigned long long)addr, node->name);
return;
}
#endif /* !CONFIG_PPC_DCR_NATIVE */
}
#endif /* CONFIG_PPC_DCR */

/* Construct the name, using parent nodes if necessary to ensure uniqueness */
while (node->parent) {
/*
Expand Down

0 comments on commit ba52464

Please sign in to comment.