Re: [PATCH] soc: Convert to using %pOFn instead of device_node.name

2018-09-30 Thread Andy Gross
On Mon, Aug 27, 2018 at 08:52:44PM -0500, Rob Herring wrote:
> In preparation to remove the node name pointer from struct device_node,
> convert printf users to use the %pOFn format specifier.
> 
> Cc: Qiang Zhao 
> Cc: Li Yang 
> Cc: Andy Gross 
> Cc: David Brown 
> Cc: Heiko Stuebner 
> Cc: Thierry Reding 
> Cc: Jonathan Hunter 
> Cc: Santosh Shilimkar 
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux-...@vger.kernel.org
> Signed-off-by: Rob Herring 
> ---

Acked-by: Andy Gross 


Re: [PATCH] soc: Convert to using %pOFn instead of device_node.name

2018-08-29 Thread Heiko Stübner
Am Dienstag, 28. August 2018, 03:52:44 CEST schrieb Rob Herring:
> In preparation to remove the node name pointer from struct device_node,
> convert printf users to use the %pOFn format specifier.

>  drivers/soc/rockchip/pm_domains.c | 44 +++

For the Rockchip-part
Acked-by: Heiko Stuebner 




RE: [PATCH] soc: Convert to using %pOFn instead of device_node.name

2018-08-29 Thread Qiang Zhao
From: Rob Herring 
Date: 2018年8月28日 9:53
> To: linux-ker...@vger.kernel.org
> Cc: Qiang Zhao ; Leo Li ; Andy
> Gross ; David Brown ; Heiko
> Stuebner ; Thierry Reding ;
> Jonathan Hunter ; Santosh Shilimkar
> ; linuxppc-dev@lists.ozlabs.org;
> linux-arm-ker...@lists.infradead.org; linux-...@vger.kernel.org
> Subject: [PATCH] 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: Qiang Zhao 
> Cc: Li Yang 
> Cc: Andy Gross 
> Cc: David Brown 
> Cc: Heiko Stuebner 
> Cc: Thierry Reding 
> Cc: Jonathan Hunter 
> Cc: Santosh Shilimkar 
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux-...@vger.kernel.org
> Signed-off-by: Rob Herring 
> ---
>  drivers/soc/dove/pmu.c|  8 +++---
>  drivers/soc/fsl/qe/qe_tdm.c   |  4 +--
>  drivers/soc/qcom/apr.c|  2 +-
>  drivers/soc/rockchip/pm_domains.c | 44 +++
>  drivers/soc/tegra/pmc.c   | 12 -
>  drivers/soc/ti/knav_dma.c |  8 +++---
>  drivers/soc/ti/knav_qmss_queue.c  |  8 +++---
>  7 files changed, 43 insertions(+), 43 deletions(-)

For qe_tdm part
Acked-by: Qiang Zhao 



Re: [PATCH] soc: Convert to using %pOFn instead of device_node.name

2018-08-28 Thread Tyrel Datwyler
On 08/28/2018 03:29 PM, Li Yang wrote:
> On Tue, Aug 28, 2018 at 5:16 PM Tyrel Datwyler
>  wrote:
>>
>> On 08/28/2018 11:48 AM, Li Yang wrote:
>>> On Mon, Aug 27, 2018 at 8:57 PM Rob Herring  wrote:

 In preparation to remove the node name pointer from struct device_node,
 convert printf users to use the %pOFn format specifier.
>>>
>>> Please forgive my ignorance, but what is this format specifier do
>>> exactly?   I cannot find anything listed in the printf specification
>>> matching this.  Is this something newly introduced?
>>>
>>> Leo
>>>
>>
>> From Documentation/core-api/printk-formats.rst:
> 
> I was trying to find it in the standard c format specifier.  :(
> Thanks a lot for the pointer.
> 

No problem. Its worth a look through. The usual integer types are at the top, 
but that is followed by the pointer types which the kernel provides quite a few 
for a variety of things.

>>
>> kobjects
>> 
>>
>> ::
>>
>> %pOF[fnpPcCF]
>>
>>
>> For printing kobject based structs (device nodes). Default behaviour is
>> equivalent to %pOFf.
>>
>> - f - device node full_name
>> - n - device node name
>> - p - device node phandle
>> - P - device node path spec (name + @unit)
>> - F - device node flags
>> - c - major compatible string
>> - C - full compatible string
>>
>>
>> -Tyrel
>>
> 



Re: [PATCH] soc: Convert to using %pOFn instead of device_node.name

2018-08-28 Thread Li Yang
On Tue, Aug 28, 2018 at 5:16 PM Tyrel Datwyler
 wrote:
>
> On 08/28/2018 11:48 AM, Li Yang wrote:
> > On Mon, Aug 27, 2018 at 8:57 PM Rob Herring  wrote:
> >>
> >> In preparation to remove the node name pointer from struct device_node,
> >> convert printf users to use the %pOFn format specifier.
> >
> > Please forgive my ignorance, but what is this format specifier do
> > exactly?   I cannot find anything listed in the printf specification
> > matching this.  Is this something newly introduced?
> >
> > Leo
> >
>
> From Documentation/core-api/printk-formats.rst:

I was trying to find it in the standard c format specifier.  :(
Thanks a lot for the pointer.

>
> kobjects
> 
>
> ::
>
> %pOF[fnpPcCF]
>
>
> For printing kobject based structs (device nodes). Default behaviour is
> equivalent to %pOFf.
>
> - f - device node full_name
> - n - device node name
> - p - device node phandle
> - P - device node path spec (name + @unit)
> - F - device node flags
> - c - major compatible string
> - C - full compatible string
>
>
> -Tyrel
>


Re: [PATCH] soc: Convert to using %pOFn instead of device_node.name

2018-08-28 Thread Tyrel Datwyler
On 08/28/2018 11:48 AM, Li Yang wrote:
> On Mon, Aug 27, 2018 at 8:57 PM Rob Herring  wrote:
>>
>> In preparation to remove the node name pointer from struct device_node,
>> convert printf users to use the %pOFn format specifier.
> 
> Please forgive my ignorance, but what is this format specifier do
> exactly?   I cannot find anything listed in the printf specification
> matching this.  Is this something newly introduced?
> 
> Leo
> 

>From Documentation/core-api/printk-formats.rst:

kobjects


::

%pOF[fnpPcCF]


For printing kobject based structs (device nodes). Default behaviour is
equivalent to %pOFf.

- f - device node full_name
- n - device node name
- p - device node phandle
- P - device node path spec (name + @unit)
- F - device node flags
- c - major compatible string
- C - full compatible string


-Tyrel



Re: [PATCH] soc: Convert to using %pOFn instead of device_node.name

2018-08-28 Thread Li Yang
On Mon, Aug 27, 2018 at 8:57 PM Rob Herring  wrote:
>
> In preparation to remove the node name pointer from struct device_node,
> convert printf users to use the %pOFn format specifier.

Please forgive my ignorance, but what is this format specifier do
exactly?   I cannot find anything listed in the printf specification
matching this.  Is this something newly introduced?

Leo


Re: [PATCH] soc: Convert to using %pOFn instead of device_node.name

2018-08-28 Thread Thierry Reding
On Mon, Aug 27, 2018 at 08:52:44PM -0500, Rob Herring wrote:
> In preparation to remove the node name pointer from struct device_node,
> convert printf users to use the %pOFn format specifier.
> 
> Cc: Qiang Zhao 
> Cc: Li Yang 
> Cc: Andy Gross 
> Cc: David Brown 
> Cc: Heiko Stuebner 
> Cc: Thierry Reding 
> Cc: Jonathan Hunter 
> Cc: Santosh Shilimkar 
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux-...@vger.kernel.org
> Signed-off-by: Rob Herring 
> ---
>  drivers/soc/dove/pmu.c|  8 +++---
>  drivers/soc/fsl/qe/qe_tdm.c   |  4 +--
>  drivers/soc/qcom/apr.c|  2 +-
>  drivers/soc/rockchip/pm_domains.c | 44 +++
>  drivers/soc/tegra/pmc.c   | 12 -
>  drivers/soc/ti/knav_dma.c |  8 +++---
>  drivers/soc/ti/knav_qmss_queue.c  |  8 +++---
>  7 files changed, 43 insertions(+), 43 deletions(-)

Acked-by: Thierry Reding 


signature.asc
Description: PGP signature


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

2018-08-27 Thread Rob Herring
In preparation to remove the node name pointer from struct device_node,
convert printf users to use the %pOFn format specifier.

Cc: Qiang Zhao 
Cc: Li Yang 
Cc: Andy Gross 
Cc: David Brown 
Cc: Heiko Stuebner 
Cc: Thierry Reding 
Cc: Jonathan Hunter 
Cc: Santosh Shilimkar 
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-...@vger.kernel.org
Signed-off-by: Rob Herring 
---
 drivers/soc/dove/pmu.c|  8 +++---
 drivers/soc/fsl/qe/qe_tdm.c   |  4 +--
 drivers/soc/qcom/apr.c|  2 +-
 drivers/soc/rockchip/pm_domains.c | 44 +++
 drivers/soc/tegra/pmc.c   | 12 -
 drivers/soc/ti/knav_dma.c |  8 +++---
 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)
 
domains_node = of_get_child_by_name(np_pmu, "domains");
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;
}
 
@@ -396,7 +396,7 @@ int __init dove_init_pmu(void)
pmu->pmc_base = of_iomap(pmu->of_node, 0);
pmu->pmu_base = of_iomap(pmu->of_node, 1);
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->pmc_base);
kfree(pmu);
@@ -414,7 +414,7 @@ int __init dove_init_pmu(void)
break;
 
domain->pmu = pmu;
-   domain->base.name = kstrdup(np->name, GFP_KERNEL);
+   domain->base.name = kasprintf(GFP_KERNEL, "%pOFn", np);
if (!domain->base.name) {
kfree(domain);
break;
@@ -444,7 +444,7 @@ int __init dove_init_pmu(void)
/* Loss of the interrupt controller is not a fatal error. */
parent_irq = irq_of_parse_and_map(pmu->of_node, 0);
if (!parent_irq) {
-   pr_err("%s: no interrupt specified\n", np_pmu->name);
+   pr_err("%pOFn: no interrupt specified\n", np_pmu);
} else {
ret = dove_init_pmu_irq(pmu, parent_irq);
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,
 
pdev = of_find_device_by_node(np2);
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);
return -EINVAL;
}
@@ -153,7 +153,7 @@ int ucc_of_parse_tdm(struct device_node *np, struct ucc_tdm 
*utdm,
pdev = of_find_device_by_node(np2);
if (!pdev) {
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);
goto err_miss_siram_property;
}
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,
adev->domain_id = id->domain_id;
adev->version = id->svc_version;
if (np)
-   strncpy(adev->name, np->name, APR_NAME_SIZE);
+   snprintf(adev->name, APR_NAME_SIZE, "%pOFn", np);
else
strncpy(adev->name, id->name, APR_NAME_SIZE);
 
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,
error = of_property_read_u32(node, "reg", &id);
if (error) {
dev_err(pmu->dev,
-   "%s: failed to retrieve domain id (reg): %d\n",
-   node->name, error);
+   "%pOFn: failed to retrieve domain id (reg): %d\n",
+   node, error);
return -EINVAL;
}
 
if (id >= pmu->info->num_domains) {
-   dev_err(pmu->dev, "%s: invalid domain id %d\n",
-   node->name, id);
+   dev_err(pmu->dev, "%pOFn: invalid domain id %d\n",
+   node, id);