diff options
author | Rob Herring <robh@kernel.org> | 2018-08-27 21:02:33 -0400 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2018-10-04 15:16:01 -0400 |
commit | dc37a25252717aab7efa4802dc1a1430392b145a (patch) | |
tree | d8121794be829c5f452b50e5cfb9932de2b886d2 | |
parent | 75afbfc1156c8f7de5717a8d278a4da0d98a8532 (diff) |
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: Thierry Reding <treding@nvidia.com>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Qiang Zhao <qiang.zhao@nxp.com>
Acked-by: Andy Gross <andy.gross@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
-rw-r--r-- | drivers/soc/dove/pmu.c | 8 | ||||
-rw-r--r-- | drivers/soc/fsl/qe/qe_tdm.c | 4 | ||||
-rw-r--r-- | drivers/soc/qcom/apr.c | 2 | ||||
-rw-r--r-- | drivers/soc/rockchip/pm_domains.c | 44 | ||||
-rw-r--r-- | drivers/soc/tegra/pmc.c | 12 | ||||
-rw-r--r-- | drivers/soc/ti/knav_dma.c | 8 | ||||
-rw-r--r-- | drivers/soc/ti/knav_qmss_queue.c | 8 |
7 files changed, 43 insertions, 43 deletions
diff --git a/drivers/soc/dove/pmu.c b/drivers/soc/dove/pmu.c index 5abb08ffb74d..ffc5311c0ed8 100644 --- a/drivers/soc/dove/pmu.c +++ b/drivers/soc/dove/pmu.c | |||
@@ -383,7 +383,7 @@ int __init dove_init_pmu(void) | |||
383 | 383 | ||
384 | domains_node = of_get_child_by_name(np_pmu, "domains"); | 384 | domains_node = of_get_child_by_name(np_pmu, "domains"); |
385 | if (!domains_node) { | 385 | if (!domains_node) { |
386 | pr_err("%s: failed to find domains sub-node\n", np_pmu->name); | 386 | pr_err("%pOFn: failed to find domains sub-node\n", np_pmu); |
387 | return 0; | 387 | return 0; |
388 | } | 388 | } |
389 | 389 | ||
@@ -396,7 +396,7 @@ int __init dove_init_pmu(void) | |||
396 | pmu->pmc_base = of_iomap(pmu->of_node, 0); | 396 | pmu->pmc_base = of_iomap(pmu->of_node, 0); |
397 | pmu->pmu_base = of_iomap(pmu->of_node, 1); | 397 | pmu->pmu_base = of_iomap(pmu->of_node, 1); |
398 | if (!pmu->pmc_base || !pmu->pmu_base) { | 398 | if (!pmu->pmc_base || !pmu->pmu_base) { |
399 | pr_err("%s: failed to map PMU\n", np_pmu->name); | 399 | pr_err("%pOFn: failed to map PMU\n", np_pmu); |
400 | iounmap(pmu->pmu_base); | 400 | iounmap(pmu->pmu_base); |
401 | iounmap(pmu->pmc_base); | 401 | iounmap(pmu->pmc_base); |
402 | kfree(pmu); | 402 | kfree(pmu); |
@@ -414,7 +414,7 @@ int __init dove_init_pmu(void) | |||
414 | break; | 414 | break; |
415 | 415 | ||
416 | domain->pmu = pmu; | 416 | domain->pmu = pmu; |
417 | domain->base.name = kstrdup(np->name, GFP_KERNEL); | 417 | domain->base.name = kasprintf(GFP_KERNEL, "%pOFn", np); |
418 | if (!domain->base.name) { | 418 | if (!domain->base.name) { |
419 | kfree(domain); | 419 | kfree(domain); |
420 | break; | 420 | break; |
@@ -444,7 +444,7 @@ int __init dove_init_pmu(void) | |||
444 | /* Loss of the interrupt controller is not a fatal error. */ | 444 | /* Loss of the interrupt controller is not a fatal error. */ |
445 | parent_irq = irq_of_parse_and_map(pmu->of_node, 0); | 445 | parent_irq = irq_of_parse_and_map(pmu->of_node, 0); |
446 | if (!parent_irq) { | 446 | if (!parent_irq) { |
447 | pr_err("%s: no interrupt specified\n", np_pmu->name); | 447 | pr_err("%pOFn: no interrupt specified\n", np_pmu); |
448 | } else { | 448 | } else { |
449 | ret = dove_init_pmu_irq(pmu, parent_irq); | 449 | ret = dove_init_pmu_irq(pmu, parent_irq); |
450 | if (ret) | 450 | if (ret) |
diff --git a/drivers/soc/fsl/qe/qe_tdm.c b/drivers/soc/fsl/qe/qe_tdm.c index f744c214f680..f78c34647ca2 100644 --- a/drivers/soc/fsl/qe/qe_tdm.c +++ b/drivers/soc/fsl/qe/qe_tdm.c | |||
@@ -131,7 +131,7 @@ int ucc_of_parse_tdm(struct device_node *np, struct ucc_tdm *utdm, | |||
131 | 131 | ||
132 | pdev = of_find_device_by_node(np2); | 132 | pdev = of_find_device_by_node(np2); |
133 | if (!pdev) { | 133 | if (!pdev) { |
134 | pr_err("%s: failed to lookup pdev\n", np2->name); | 134 | pr_err("%pOFn: failed to lookup pdev\n", np2); |
135 | of_node_put(np2); | 135 | of_node_put(np2); |
136 | return -EINVAL; | 136 | return -EINVAL; |
137 | } | 137 | } |
@@ -153,7 +153,7 @@ int ucc_of_parse_tdm(struct device_node *np, struct ucc_tdm *utdm, | |||
153 | pdev = of_find_device_by_node(np2); | 153 | pdev = of_find_device_by_node(np2); |
154 | if (!pdev) { | 154 | if (!pdev) { |
155 | ret = -EINVAL; | 155 | ret = -EINVAL; |
156 | pr_err("%s: failed to lookup pdev\n", np2->name); | 156 | pr_err("%pOFn: failed to lookup pdev\n", np2); |
157 | of_node_put(np2); | 157 | of_node_put(np2); |
158 | goto err_miss_siram_property; | 158 | goto err_miss_siram_property; |
159 | } | 159 | } |
diff --git a/drivers/soc/qcom/apr.c b/drivers/soc/qcom/apr.c index 57af8a537332..4bda793ba6ae 100644 --- a/drivers/soc/qcom/apr.c +++ b/drivers/soc/qcom/apr.c | |||
@@ -219,7 +219,7 @@ static int apr_add_device(struct device *dev, struct device_node *np, | |||
219 | adev->domain_id = id->domain_id; | 219 | adev->domain_id = id->domain_id; |
220 | adev->version = id->svc_version; | 220 | adev->version = id->svc_version; |
221 | if (np) | 221 | if (np) |
222 | strncpy(adev->name, np->name, APR_NAME_SIZE); | 222 | snprintf(adev->name, APR_NAME_SIZE, "%pOFn", np); |
223 | else | 223 | else |
224 | strncpy(adev->name, id->name, APR_NAME_SIZE); | 224 | strncpy(adev->name, id->name, APR_NAME_SIZE); |
225 | 225 | ||
diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c index 6dff8682155f..6f86a726bb45 100644 --- a/drivers/soc/rockchip/pm_domains.c +++ b/drivers/soc/rockchip/pm_domains.c | |||
@@ -392,21 +392,21 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu, | |||
392 | error = of_property_read_u32(node, "reg", &id); | 392 | error = of_property_read_u32(node, "reg", &id); |
393 | if (error) { | 393 | if (error) { |
394 | dev_err(pmu->dev, | 394 | dev_err(pmu->dev, |
395 | "%s: failed to retrieve domain id (reg): %d\n", | 395 | "%pOFn: failed to retrieve domain id (reg): %d\n", |
396 | node->name, error); | 396 | node, error); |
397 | return -EINVAL; | 397 | return -EINVAL; |
398 | } | 398 | } |
399 | 399 | ||
400 | if (id >= pmu->info->num_domains) { | 400 | if (id >= pmu->info->num_domains) { |
401 | dev_err(pmu->dev, "%s: invalid domain id %d\n", | 401 | dev_err(pmu->dev, "%pOFn: invalid domain id %d\n", |
402 | node->name, id); | 402 | node, id); |
403 | return -EINVAL; | 403 | return -EINVAL; |
404 | } | 404 | } |
405 | 405 | ||
406 | pd_info = &pmu->info->domain_info[id]; | 406 | pd_info = &pmu->info->domain_info[id]; |
407 | if (!pd_info) { | 407 | if (!pd_info) { |
408 | dev_err(pmu->dev, "%s: undefined domain id %d\n", | 408 | dev_err(pmu->dev, "%pOFn: undefined domain id %d\n", |
409 | node->name, id); | 409 | node, id); |
410 | return -EINVAL; | 410 | return -EINVAL; |
411 | } | 411 | } |
412 | 412 | ||
@@ -424,8 +424,8 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu, | |||
424 | if (!pd->clks) | 424 | if (!pd->clks) |
425 | return -ENOMEM; | 425 | return -ENOMEM; |
426 | } else { | 426 | } else { |
427 | dev_dbg(pmu->dev, "%s: doesn't have clocks: %d\n", | 427 | dev_dbg(pmu->dev, "%pOFn: doesn't have clocks: %d\n", |
428 | node->name, pd->num_clks); | 428 | node, pd->num_clks); |
429 | pd->num_clks = 0; | 429 | pd->num_clks = 0; |
430 | } | 430 | } |
431 | 431 | ||
@@ -434,8 +434,8 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu, | |||
434 | if (IS_ERR(pd->clks[i].clk)) { | 434 | if (IS_ERR(pd->clks[i].clk)) { |
435 | error = PTR_ERR(pd->clks[i].clk); | 435 | error = PTR_ERR(pd->clks[i].clk); |
436 | dev_err(pmu->dev, | 436 | dev_err(pmu->dev, |
437 | "%s: failed to get clk at index %d: %d\n", | 437 | "%pOFn: failed to get clk at index %d: %d\n", |
438 | node->name, i, error); | 438 | node, i, error); |
439 | return error; | 439 | return error; |
440 | } | 440 | } |
441 | } | 441 | } |
@@ -486,8 +486,8 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu, | |||
486 | error = rockchip_pd_power(pd, true); | 486 | error = rockchip_pd_power(pd, true); |
487 | if (error) { | 487 | if (error) { |
488 | dev_err(pmu->dev, | 488 | dev_err(pmu->dev, |
489 | "failed to power on domain '%s': %d\n", | 489 | "failed to power on domain '%pOFn': %d\n", |
490 | node->name, error); | 490 | node, error); |
491 | goto err_unprepare_clocks; | 491 | goto err_unprepare_clocks; |
492 | } | 492 | } |
493 | 493 | ||
@@ -575,24 +575,24 @@ static int rockchip_pm_add_subdomain(struct rockchip_pmu *pmu, | |||
575 | error = of_property_read_u32(parent, "reg", &idx); | 575 | error = of_property_read_u32(parent, "reg", &idx); |
576 | if (error) { | 576 | if (error) { |
577 | dev_err(pmu->dev, | 577 | dev_err(pmu->dev, |
578 | "%s: failed to retrieve domain id (reg): %d\n", | 578 | "%pOFn: failed to retrieve domain id (reg): %d\n", |
579 | parent->name, error); | 579 | parent, error); |
580 | goto err_out; | 580 | goto err_out; |
581 | } | 581 | } |
582 | parent_domain = pmu->genpd_data.domains[idx]; | 582 | parent_domain = pmu->genpd_data.domains[idx]; |
583 | 583 | ||
584 | error = rockchip_pm_add_one_domain(pmu, np); | 584 | error = rockchip_pm_add_one_domain(pmu, np); |
585 | if (error) { | 585 | if (error) { |
586 | dev_err(pmu->dev, "failed to handle node %s: %d\n", | 586 | dev_err(pmu->dev, "failed to handle node %pOFn: %d\n", |
587 | np->name, error); | 587 | np, error); |
588 | goto err_out; | 588 | goto err_out; |
589 | } | 589 | } |
590 | 590 | ||
591 | error = of_property_read_u32(np, "reg", &idx); | 591 | error = of_property_read_u32(np, "reg", &idx); |
592 | if (error) { | 592 | if (error) { |
593 | dev_err(pmu->dev, | 593 | dev_err(pmu->dev, |
594 | "%s: failed to retrieve domain id (reg): %d\n", | 594 | "%pOFn: failed to retrieve domain id (reg): %d\n", |
595 | np->name, error); | 595 | np, error); |
596 | goto err_out; | 596 | goto err_out; |
597 | } | 597 | } |
598 | child_domain = pmu->genpd_data.domains[idx]; | 598 | child_domain = pmu->genpd_data.domains[idx]; |
@@ -683,16 +683,16 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev) | |||
683 | for_each_available_child_of_node(np, node) { | 683 | for_each_available_child_of_node(np, node) { |
684 | error = rockchip_pm_add_one_domain(pmu, node); | 684 | error = rockchip_pm_add_one_domain(pmu, node); |
685 | if (error) { | 685 | if (error) { |
686 | dev_err(dev, "failed to handle node %s: %d\n", | 686 | dev_err(dev, "failed to handle node %pOFn: %d\n", |
687 | node->name, error); | 687 | node, error); |
688 | of_node_put(node); | 688 | of_node_put(node); |
689 | goto err_out; | 689 | goto err_out; |
690 | } | 690 | } |
691 | 691 | ||
692 | error = rockchip_pm_add_subdomain(pmu, node); | 692 | error = rockchip_pm_add_subdomain(pmu, node); |
693 | if (error < 0) { | 693 | if (error < 0) { |
694 | dev_err(dev, "failed to handle subdomain node %s: %d\n", | 694 | dev_err(dev, "failed to handle subdomain node %pOFn: %d\n", |
695 | node->name, error); | 695 | node, error); |
696 | of_node_put(node); | 696 | of_node_put(node); |
697 | goto err_out; | 697 | goto err_out; |
698 | } | 698 | } |
diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index 2d6f3fcf3211..acbe63e925d5 100644 --- a/drivers/soc/tegra/pmc.c +++ b/drivers/soc/tegra/pmc.c | |||
@@ -796,7 +796,7 @@ static void tegra_powergate_add(struct tegra_pmc *pmc, struct device_node *np) | |||
796 | 796 | ||
797 | id = tegra_powergate_lookup(pmc, np->name); | 797 | id = tegra_powergate_lookup(pmc, np->name); |
798 | if (id < 0) { | 798 | if (id < 0) { |
799 | pr_err("powergate lookup failed for %s: %d\n", np->name, id); | 799 | pr_err("powergate lookup failed for %pOFn: %d\n", np, id); |
800 | goto free_mem; | 800 | goto free_mem; |
801 | } | 801 | } |
802 | 802 | ||
@@ -816,13 +816,13 @@ static void tegra_powergate_add(struct tegra_pmc *pmc, struct device_node *np) | |||
816 | 816 | ||
817 | err = tegra_powergate_of_get_clks(pg, np); | 817 | err = tegra_powergate_of_get_clks(pg, np); |
818 | if (err < 0) { | 818 | if (err < 0) { |
819 | pr_err("failed to get clocks for %s: %d\n", np->name, err); | 819 | pr_err("failed to get clocks for %pOFn: %d\n", np, err); |
820 | goto set_available; | 820 | goto set_available; |
821 | } | 821 | } |
822 | 822 | ||
823 | err = tegra_powergate_of_get_resets(pg, np, off); | 823 | err = tegra_powergate_of_get_resets(pg, np, off); |
824 | if (err < 0) { | 824 | if (err < 0) { |
825 | pr_err("failed to get resets for %s: %d\n", np->name, err); | 825 | pr_err("failed to get resets for %pOFn: %d\n", np, err); |
826 | goto remove_clks; | 826 | goto remove_clks; |
827 | } | 827 | } |
828 | 828 | ||
@@ -851,15 +851,15 @@ static void tegra_powergate_add(struct tegra_pmc *pmc, struct device_node *np) | |||
851 | 851 | ||
852 | err = pm_genpd_init(&pg->genpd, NULL, off); | 852 | err = pm_genpd_init(&pg->genpd, NULL, off); |
853 | if (err < 0) { | 853 | if (err < 0) { |
854 | pr_err("failed to initialise PM domain %s: %d\n", np->name, | 854 | pr_err("failed to initialise PM domain %pOFn: %d\n", np, |
855 | err); | 855 | err); |
856 | goto remove_resets; | 856 | goto remove_resets; |
857 | } | 857 | } |
858 | 858 | ||
859 | err = of_genpd_add_provider_simple(np, &pg->genpd); | 859 | err = of_genpd_add_provider_simple(np, &pg->genpd); |
860 | if (err < 0) { | 860 | if (err < 0) { |
861 | pr_err("failed to add PM domain provider for %s: %d\n", | 861 | pr_err("failed to add PM domain provider for %pOFn: %d\n", |
862 | np->name, err); | 862 | np, err); |
863 | goto remove_genpd; | 863 | goto remove_genpd; |
864 | } | 864 | } |
865 | 865 | ||
diff --git a/drivers/soc/ti/knav_dma.c b/drivers/soc/ti/knav_dma.c index 224d7ddeeb76..bbd4e5bc8707 100644 --- a/drivers/soc/ti/knav_dma.c +++ b/drivers/soc/ti/knav_dma.c | |||
@@ -544,15 +544,15 @@ static void __iomem *pktdma_get_regs(struct knav_dma_device *dma, | |||
544 | 544 | ||
545 | ret = of_address_to_resource(node, index, &res); | 545 | ret = of_address_to_resource(node, index, &res); |
546 | if (ret) { | 546 | if (ret) { |
547 | dev_err(dev, "Can't translate of node(%s) address for index(%d)\n", | 547 | dev_err(dev, "Can't translate of node(%pOFn) address for index(%d)\n", |
548 | node->name, index); | 548 | node, index); |
549 | return ERR_PTR(ret); | 549 | return ERR_PTR(ret); |
550 | } | 550 | } |
551 | 551 | ||
552 | regs = devm_ioremap_resource(kdev->dev, &res); | 552 | regs = devm_ioremap_resource(kdev->dev, &res); |
553 | if (IS_ERR(regs)) | 553 | if (IS_ERR(regs)) |
554 | dev_err(dev, "Failed to map register base for index(%d) node(%s)\n", | 554 | dev_err(dev, "Failed to map register base for index(%d) node(%pOFn)\n", |
555 | index, node->name); | 555 | index, node); |
556 | if (_size) | 556 | if (_size) |
557 | *_size = resource_size(&res); | 557 | *_size = resource_size(&res); |
558 | 558 | ||
diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c index 6755f2af5619..b5d5673c255c 100644 --- a/drivers/soc/ti/knav_qmss_queue.c +++ b/drivers/soc/ti/knav_qmss_queue.c | |||
@@ -1382,15 +1382,15 @@ static void __iomem *knav_queue_map_reg(struct knav_device *kdev, | |||
1382 | 1382 | ||
1383 | ret = of_address_to_resource(node, index, &res); | 1383 | ret = of_address_to_resource(node, index, &res); |
1384 | if (ret) { | 1384 | if (ret) { |
1385 | dev_err(kdev->dev, "Can't translate of node(%s) address for index(%d)\n", | 1385 | dev_err(kdev->dev, "Can't translate of node(%pOFn) address for index(%d)\n", |
1386 | node->name, index); | 1386 | node, index); |
1387 | return ERR_PTR(ret); | 1387 | return ERR_PTR(ret); |
1388 | } | 1388 | } |
1389 | 1389 | ||
1390 | regs = devm_ioremap_resource(kdev->dev, &res); | 1390 | regs = devm_ioremap_resource(kdev->dev, &res); |
1391 | if (IS_ERR(regs)) | 1391 | if (IS_ERR(regs)) |
1392 | dev_err(kdev->dev, "Failed to map register base for index(%d) node(%s)\n", | 1392 | dev_err(kdev->dev, "Failed to map register base for index(%d) node(%pOFn)\n", |
1393 | index, node->name); | 1393 | index, node); |
1394 | return regs; | 1394 | return regs; |
1395 | } | 1395 | } |
1396 | 1396 | ||