Commit dc37a252 authored by Rob Herring's avatar Rob Herring

soc: Convert to using %pOFn instead of device_node.name

In preparation to remove the node name pointer from struct device_node,
convert printf users to use the %pOFn format specifier.

Cc: Li Yang <leoyang.li@nxp.com>
Cc: David Brown <david.brown@linaro.org>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Cc: Santosh Shilimkar <ssantosh@kernel.org>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-soc@vger.kernel.org
Acked-by: default avatarThierry Reding <treding@nvidia.com>
Acked-by: default avatarHeiko Stuebner <heiko@sntech.de>
Acked-by: default avatarQiang Zhao <qiang.zhao@nxp.com>
Acked-by: default avatarAndy Gross <andy.gross@linaro.org>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent 75afbfc1
...@@ -383,7 +383,7 @@ int __init dove_init_pmu(void) ...@@ -383,7 +383,7 @@ int __init dove_init_pmu(void)
domains_node = of_get_child_by_name(np_pmu, "domains"); domains_node = of_get_child_by_name(np_pmu, "domains");
if (!domains_node) { if (!domains_node) {
pr_err("%s: failed to find domains sub-node\n", np_pmu->name); pr_err("%pOFn: failed to find domains sub-node\n", np_pmu);
return 0; return 0;
} }
...@@ -396,7 +396,7 @@ int __init dove_init_pmu(void) ...@@ -396,7 +396,7 @@ int __init dove_init_pmu(void)
pmu->pmc_base = of_iomap(pmu->of_node, 0); pmu->pmc_base = of_iomap(pmu->of_node, 0);
pmu->pmu_base = of_iomap(pmu->of_node, 1); pmu->pmu_base = of_iomap(pmu->of_node, 1);
if (!pmu->pmc_base || !pmu->pmu_base) { if (!pmu->pmc_base || !pmu->pmu_base) {
pr_err("%s: failed to map PMU\n", np_pmu->name); pr_err("%pOFn: failed to map PMU\n", np_pmu);
iounmap(pmu->pmu_base); iounmap(pmu->pmu_base);
iounmap(pmu->pmc_base); iounmap(pmu->pmc_base);
kfree(pmu); kfree(pmu);
...@@ -414,7 +414,7 @@ int __init dove_init_pmu(void) ...@@ -414,7 +414,7 @@ int __init dove_init_pmu(void)
break; break;
domain->pmu = pmu; domain->pmu = pmu;
domain->base.name = kstrdup(np->name, GFP_KERNEL); domain->base.name = kasprintf(GFP_KERNEL, "%pOFn", np);
if (!domain->base.name) { if (!domain->base.name) {
kfree(domain); kfree(domain);
break; break;
...@@ -444,7 +444,7 @@ int __init dove_init_pmu(void) ...@@ -444,7 +444,7 @@ int __init dove_init_pmu(void)
/* Loss of the interrupt controller is not a fatal error. */ /* Loss of the interrupt controller is not a fatal error. */
parent_irq = irq_of_parse_and_map(pmu->of_node, 0); parent_irq = irq_of_parse_and_map(pmu->of_node, 0);
if (!parent_irq) { if (!parent_irq) {
pr_err("%s: no interrupt specified\n", np_pmu->name); pr_err("%pOFn: no interrupt specified\n", np_pmu);
} else { } else {
ret = dove_init_pmu_irq(pmu, parent_irq); ret = dove_init_pmu_irq(pmu, parent_irq);
if (ret) if (ret)
......
...@@ -131,7 +131,7 @@ int ucc_of_parse_tdm(struct device_node *np, struct ucc_tdm *utdm, ...@@ -131,7 +131,7 @@ int ucc_of_parse_tdm(struct device_node *np, struct ucc_tdm *utdm,
pdev = of_find_device_by_node(np2); pdev = of_find_device_by_node(np2);
if (!pdev) { if (!pdev) {
pr_err("%s: failed to lookup pdev\n", np2->name); pr_err("%pOFn: failed to lookup pdev\n", np2);
of_node_put(np2); of_node_put(np2);
return -EINVAL; return -EINVAL;
} }
...@@ -153,7 +153,7 @@ int ucc_of_parse_tdm(struct device_node *np, struct ucc_tdm *utdm, ...@@ -153,7 +153,7 @@ int ucc_of_parse_tdm(struct device_node *np, struct ucc_tdm *utdm,
pdev = of_find_device_by_node(np2); pdev = of_find_device_by_node(np2);
if (!pdev) { if (!pdev) {
ret = -EINVAL; ret = -EINVAL;
pr_err("%s: failed to lookup pdev\n", np2->name); pr_err("%pOFn: failed to lookup pdev\n", np2);
of_node_put(np2); of_node_put(np2);
goto err_miss_siram_property; goto err_miss_siram_property;
} }
......
...@@ -219,7 +219,7 @@ static int apr_add_device(struct device *dev, struct device_node *np, ...@@ -219,7 +219,7 @@ static int apr_add_device(struct device *dev, struct device_node *np,
adev->domain_id = id->domain_id; adev->domain_id = id->domain_id;
adev->version = id->svc_version; adev->version = id->svc_version;
if (np) if (np)
strncpy(adev->name, np->name, APR_NAME_SIZE); snprintf(adev->name, APR_NAME_SIZE, "%pOFn", np);
else else
strncpy(adev->name, id->name, APR_NAME_SIZE); strncpy(adev->name, id->name, APR_NAME_SIZE);
......
...@@ -392,21 +392,21 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu, ...@@ -392,21 +392,21 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu,
error = of_property_read_u32(node, "reg", &id); error = of_property_read_u32(node, "reg", &id);
if (error) { if (error) {
dev_err(pmu->dev, dev_err(pmu->dev,
"%s: failed to retrieve domain id (reg): %d\n", "%pOFn: failed to retrieve domain id (reg): %d\n",
node->name, error); node, error);
return -EINVAL; return -EINVAL;
} }
if (id >= pmu->info->num_domains) { if (id >= pmu->info->num_domains) {
dev_err(pmu->dev, "%s: invalid domain id %d\n", dev_err(pmu->dev, "%pOFn: invalid domain id %d\n",
node->name, id); node, id);
return -EINVAL; return -EINVAL;
} }
pd_info = &pmu->info->domain_info[id]; pd_info = &pmu->info->domain_info[id];
if (!pd_info) { if (!pd_info) {
dev_err(pmu->dev, "%s: undefined domain id %d\n", dev_err(pmu->dev, "%pOFn: undefined domain id %d\n",
node->name, id); node, id);
return -EINVAL; return -EINVAL;
} }
...@@ -424,8 +424,8 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu, ...@@ -424,8 +424,8 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu,
if (!pd->clks) if (!pd->clks)
return -ENOMEM; return -ENOMEM;
} else { } else {
dev_dbg(pmu->dev, "%s: doesn't have clocks: %d\n", dev_dbg(pmu->dev, "%pOFn: doesn't have clocks: %d\n",
node->name, pd->num_clks); node, pd->num_clks);
pd->num_clks = 0; pd->num_clks = 0;
} }
...@@ -434,8 +434,8 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu, ...@@ -434,8 +434,8 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu,
if (IS_ERR(pd->clks[i].clk)) { if (IS_ERR(pd->clks[i].clk)) {
error = PTR_ERR(pd->clks[i].clk); error = PTR_ERR(pd->clks[i].clk);
dev_err(pmu->dev, dev_err(pmu->dev,
"%s: failed to get clk at index %d: %d\n", "%pOFn: failed to get clk at index %d: %d\n",
node->name, i, error); node, i, error);
return error; return error;
} }
} }
...@@ -486,8 +486,8 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu, ...@@ -486,8 +486,8 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu,
error = rockchip_pd_power(pd, true); error = rockchip_pd_power(pd, true);
if (error) { if (error) {
dev_err(pmu->dev, dev_err(pmu->dev,
"failed to power on domain '%s': %d\n", "failed to power on domain '%pOFn': %d\n",
node->name, error); node, error);
goto err_unprepare_clocks; goto err_unprepare_clocks;
} }
...@@ -575,24 +575,24 @@ static int rockchip_pm_add_subdomain(struct rockchip_pmu *pmu, ...@@ -575,24 +575,24 @@ static int rockchip_pm_add_subdomain(struct rockchip_pmu *pmu,
error = of_property_read_u32(parent, "reg", &idx); error = of_property_read_u32(parent, "reg", &idx);
if (error) { if (error) {
dev_err(pmu->dev, dev_err(pmu->dev,
"%s: failed to retrieve domain id (reg): %d\n", "%pOFn: failed to retrieve domain id (reg): %d\n",
parent->name, error); parent, error);
goto err_out; goto err_out;
} }
parent_domain = pmu->genpd_data.domains[idx]; parent_domain = pmu->genpd_data.domains[idx];
error = rockchip_pm_add_one_domain(pmu, np); error = rockchip_pm_add_one_domain(pmu, np);
if (error) { if (error) {
dev_err(pmu->dev, "failed to handle node %s: %d\n", dev_err(pmu->dev, "failed to handle node %pOFn: %d\n",
np->name, error); np, error);
goto err_out; goto err_out;
} }
error = of_property_read_u32(np, "reg", &idx); error = of_property_read_u32(np, "reg", &idx);
if (error) { if (error) {
dev_err(pmu->dev, dev_err(pmu->dev,
"%s: failed to retrieve domain id (reg): %d\n", "%pOFn: failed to retrieve domain id (reg): %d\n",
np->name, error); np, error);
goto err_out; goto err_out;
} }
child_domain = pmu->genpd_data.domains[idx]; child_domain = pmu->genpd_data.domains[idx];
...@@ -683,16 +683,16 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev) ...@@ -683,16 +683,16 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev)
for_each_available_child_of_node(np, node) { for_each_available_child_of_node(np, node) {
error = rockchip_pm_add_one_domain(pmu, node); error = rockchip_pm_add_one_domain(pmu, node);
if (error) { if (error) {
dev_err(dev, "failed to handle node %s: %d\n", dev_err(dev, "failed to handle node %pOFn: %d\n",
node->name, error); node, error);
of_node_put(node); of_node_put(node);
goto err_out; goto err_out;
} }
error = rockchip_pm_add_subdomain(pmu, node); error = rockchip_pm_add_subdomain(pmu, node);
if (error < 0) { if (error < 0) {
dev_err(dev, "failed to handle subdomain node %s: %d\n", dev_err(dev, "failed to handle subdomain node %pOFn: %d\n",
node->name, error); node, error);
of_node_put(node); of_node_put(node);
goto err_out; goto err_out;
} }
......
...@@ -796,7 +796,7 @@ static void tegra_powergate_add(struct tegra_pmc *pmc, struct device_node *np) ...@@ -796,7 +796,7 @@ static void tegra_powergate_add(struct tegra_pmc *pmc, struct device_node *np)
id = tegra_powergate_lookup(pmc, np->name); id = tegra_powergate_lookup(pmc, np->name);
if (id < 0) { if (id < 0) {
pr_err("powergate lookup failed for %s: %d\n", np->name, id); pr_err("powergate lookup failed for %pOFn: %d\n", np, id);
goto free_mem; goto free_mem;
} }
...@@ -816,13 +816,13 @@ static void tegra_powergate_add(struct tegra_pmc *pmc, struct device_node *np) ...@@ -816,13 +816,13 @@ static void tegra_powergate_add(struct tegra_pmc *pmc, struct device_node *np)
err = tegra_powergate_of_get_clks(pg, np); err = tegra_powergate_of_get_clks(pg, np);
if (err < 0) { if (err < 0) {
pr_err("failed to get clocks for %s: %d\n", np->name, err); pr_err("failed to get clocks for %pOFn: %d\n", np, err);
goto set_available; goto set_available;
} }
err = tegra_powergate_of_get_resets(pg, np, off); err = tegra_powergate_of_get_resets(pg, np, off);
if (err < 0) { if (err < 0) {
pr_err("failed to get resets for %s: %d\n", np->name, err); pr_err("failed to get resets for %pOFn: %d\n", np, err);
goto remove_clks; goto remove_clks;
} }
...@@ -851,15 +851,15 @@ static void tegra_powergate_add(struct tegra_pmc *pmc, struct device_node *np) ...@@ -851,15 +851,15 @@ static void tegra_powergate_add(struct tegra_pmc *pmc, struct device_node *np)
err = pm_genpd_init(&pg->genpd, NULL, off); err = pm_genpd_init(&pg->genpd, NULL, off);
if (err < 0) { if (err < 0) {
pr_err("failed to initialise PM domain %s: %d\n", np->name, pr_err("failed to initialise PM domain %pOFn: %d\n", np,
err); err);
goto remove_resets; goto remove_resets;
} }
err = of_genpd_add_provider_simple(np, &pg->genpd); err = of_genpd_add_provider_simple(np, &pg->genpd);
if (err < 0) { if (err < 0) {
pr_err("failed to add PM domain provider for %s: %d\n", pr_err("failed to add PM domain provider for %pOFn: %d\n",
np->name, err); np, err);
goto remove_genpd; goto remove_genpd;
} }
......
...@@ -544,15 +544,15 @@ static void __iomem *pktdma_get_regs(struct knav_dma_device *dma, ...@@ -544,15 +544,15 @@ static void __iomem *pktdma_get_regs(struct knav_dma_device *dma,
ret = of_address_to_resource(node, index, &res); ret = of_address_to_resource(node, index, &res);
if (ret) { if (ret) {
dev_err(dev, "Can't translate of node(%s) address for index(%d)\n", dev_err(dev, "Can't translate of node(%pOFn) address for index(%d)\n",
node->name, index); node, index);
return ERR_PTR(ret); return ERR_PTR(ret);
} }
regs = devm_ioremap_resource(kdev->dev, &res); regs = devm_ioremap_resource(kdev->dev, &res);
if (IS_ERR(regs)) if (IS_ERR(regs))
dev_err(dev, "Failed to map register base for index(%d) node(%s)\n", dev_err(dev, "Failed to map register base for index(%d) node(%pOFn)\n",
index, node->name); index, node);
if (_size) if (_size)
*_size = resource_size(&res); *_size = resource_size(&res);
......
...@@ -1382,15 +1382,15 @@ static void __iomem *knav_queue_map_reg(struct knav_device *kdev, ...@@ -1382,15 +1382,15 @@ static void __iomem *knav_queue_map_reg(struct knav_device *kdev,
ret = of_address_to_resource(node, index, &res); ret = of_address_to_resource(node, index, &res);
if (ret) { if (ret) {
dev_err(kdev->dev, "Can't translate of node(%s) address for index(%d)\n", dev_err(kdev->dev, "Can't translate of node(%pOFn) address for index(%d)\n",
node->name, index); node, index);
return ERR_PTR(ret); return ERR_PTR(ret);
} }
regs = devm_ioremap_resource(kdev->dev, &res); regs = devm_ioremap_resource(kdev->dev, &res);
if (IS_ERR(regs)) if (IS_ERR(regs))
dev_err(kdev->dev, "Failed to map register base for index(%d) node(%s)\n", dev_err(kdev->dev, "Failed to map register base for index(%d) node(%pOFn)\n",
index, node->name); index, node);
return regs; return regs;
} }
......
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