diff options
author | Rob Herring <robh@kernel.org> | 2014-05-14 01:34:35 +0200 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2014-05-14 01:34:35 +0200 |
commit | eafd370dfe487facfdef499057f4eac9aa0b4bf5 (patch) | |
tree | 0925a67cd658cdf4811f49b4cd2073f663166bd0 /drivers/of/platform.c | |
parent | of: push struct boot_param_header and defines into powerpc (diff) | |
parent | of/selftest: add testcase for nodes with same name and address (diff) | |
download | linux-eafd370dfe487facfdef499057f4eac9aa0b4bf5.tar.xz linux-eafd370dfe487facfdef499057f4eac9aa0b4bf5.zip |
Merge branch 'dt-bus-name' into for-next
Diffstat (limited to 'drivers/of/platform.c')
-rw-r--r-- | drivers/of/platform.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 404d1daebefa..d0009b3614af 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -78,7 +78,6 @@ void of_device_make_bus_id(struct device *dev) struct device_node *node = dev->of_node; const __be32 *reg; u64 addr; - const __be32 *addrp; int magic; #ifdef CONFIG_PPC_DCR @@ -106,15 +105,7 @@ void of_device_make_bus_id(struct device *dev) */ reg = of_get_property(node, "reg", NULL); if (reg) { - if (of_can_translate_address(node)) { - addr = of_translate_address(node, reg); - } else { - addrp = of_get_address(node, 0, NULL, NULL); - if (addrp) - addr = of_read_number(addrp, 1); - else - addr = OF_BAD_ADDR; - } + addr = of_translate_address(node, reg); if (addr != OF_BAD_ADDR) { dev_set_name(dev, "%llx.%s", (unsigned long long)addr, node->name); @@ -149,9 +140,8 @@ struct platform_device *of_device_alloc(struct device_node *np, return NULL; /* count the io and irq resources */ - if (of_can_translate_address(np)) - while (of_address_to_resource(np, num_reg, &temp_res) == 0) - num_reg++; + while (of_address_to_resource(np, num_reg, &temp_res) == 0) + num_reg++; num_irq = of_irq_count(np); /* Populate the resource table */ @@ -168,7 +158,9 @@ struct platform_device *of_device_alloc(struct device_node *np, rc = of_address_to_resource(np, i, res); WARN_ON(rc); } - WARN_ON(of_irq_to_resource_table(np, res, num_irq) != num_irq); + if (of_irq_to_resource_table(np, res, num_irq) != num_irq) + pr_debug("not all legacy IRQ resources mapped for %s\n", + np->name); } dev->dev.of_node = of_node_get(np); |