Commit d9c6866b authored by Rob Herring's avatar Rob Herring

of: kill off of_can_translate_address

of_can_translate_address only checks some conditions for address
translation, but does not check other conditions like having range
properties. The checks it does do are redundant with
__of_address_translate. The only difference is printing a message or
not. Since we only have a single caller that does the full translation
anyway, just remove of_can_translate_address and quiet the error
message.

Cc: Grant Likely <grant.likely@linaro.org>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Tested-by: default avatarFrank Rowand <frank.rowand@sonymobile.com>
Reviewed-by: default avatarFrank Rowand <frank.rowand@sonymobile.com>
parent b8acee3e
...@@ -498,8 +498,7 @@ static u64 __of_translate_address(struct device_node *dev, ...@@ -498,8 +498,7 @@ static u64 __of_translate_address(struct device_node *dev,
/* Count address cells & copy address locally */ /* Count address cells & copy address locally */
bus->count_cells(dev, &na, &ns); bus->count_cells(dev, &na, &ns);
if (!OF_CHECK_COUNTS(na, ns)) { if (!OF_CHECK_COUNTS(na, ns)) {
printk(KERN_ERR "prom_parse: Bad cell count for %s\n", pr_debug("OF: Bad cell count for %s\n", of_node_full_name(dev));
of_node_full_name(dev));
goto bail; goto bail;
} }
memcpy(addr, in_addr, na * 4); memcpy(addr, in_addr, na * 4);
...@@ -564,25 +563,6 @@ u64 of_translate_dma_address(struct device_node *dev, const __be32 *in_addr) ...@@ -564,25 +563,6 @@ u64 of_translate_dma_address(struct device_node *dev, const __be32 *in_addr)
} }
EXPORT_SYMBOL(of_translate_dma_address); EXPORT_SYMBOL(of_translate_dma_address);
bool of_can_translate_address(struct device_node *dev)
{
struct device_node *parent;
struct of_bus *bus;
int na, ns;
parent = of_get_parent(dev);
if (parent == NULL)
return false;
bus = of_match_bus(parent);
bus->count_cells(dev, &na, &ns);
of_node_put(parent);
return OF_CHECK_COUNTS(na, ns);
}
EXPORT_SYMBOL(of_can_translate_address);
const __be32 *of_get_address(struct device_node *dev, int index, u64 *size, const __be32 *of_get_address(struct device_node *dev, int index, u64 *size,
unsigned int *flags) unsigned int *flags)
{ {
......
...@@ -140,9 +140,8 @@ struct platform_device *of_device_alloc(struct device_node *np, ...@@ -140,9 +140,8 @@ struct platform_device *of_device_alloc(struct device_node *np,
return NULL; return NULL;
/* count the io and irq resources */ /* count the io and irq resources */
if (of_can_translate_address(np)) while (of_address_to_resource(np, num_reg, &temp_res) == 0)
while (of_address_to_resource(np, num_reg, &temp_res) == 0) num_reg++;
num_reg++;
num_irq = of_irq_count(np); num_irq = of_irq_count(np);
/* Populate the resource table */ /* Populate the resource table */
......
...@@ -40,7 +40,6 @@ extern u64 of_translate_dma_address(struct device_node *dev, ...@@ -40,7 +40,6 @@ extern u64 of_translate_dma_address(struct device_node *dev,
#ifdef CONFIG_OF_ADDRESS #ifdef CONFIG_OF_ADDRESS
extern u64 of_translate_address(struct device_node *np, const __be32 *addr); extern u64 of_translate_address(struct device_node *np, const __be32 *addr);
extern bool of_can_translate_address(struct device_node *dev);
extern int of_address_to_resource(struct device_node *dev, int index, extern int of_address_to_resource(struct device_node *dev, int index,
struct resource *r); struct resource *r);
extern struct device_node *of_find_matching_node_by_address( extern struct device_node *of_find_matching_node_by_address(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment