Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] firmware: arm_scmi: Simplify printks with pOF format
@ 2025-09-12  9:24 Krzysztof Kozlowski
  2025-09-12  9:34 ` Krzysztof Kozlowski
  2025-09-12 11:19 ` Sudeep Holla
  0 siblings, 2 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2025-09-12  9:24 UTC (permalink / raw)
  To: Sudeep Holla, Cristian Marussi, arm-scmi, linux-arm-kernel,
	linux-kernel
  Cc: Krzysztof Kozlowski

Print full device node name with %pOF format, so the code will be a bit
simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/firmware/arm_scmi/bus.c                | 13 ++++++-------
 drivers/firmware/arm_scmi/transports/mailbox.c |  7 +++----
 2 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
index 24e59ddf85e7..c7698cfaa4e8 100644
--- a/drivers/firmware/arm_scmi/bus.c
+++ b/drivers/firmware/arm_scmi/bus.c
@@ -401,8 +401,8 @@ static void scmi_device_release(struct device *dev)
 
 static void __scmi_device_destroy(struct scmi_device *scmi_dev)
 {
-	pr_debug("(%s) Destroying SCMI device '%s' for protocol 0x%x (%s)\n",
-		 of_node_full_name(scmi_dev->dev.parent->of_node),
+	pr_debug("(%pOF) Destroying SCMI device '%s' for protocol 0x%x (%s)\n",
+		 scmi_dev->dev.parent->of_node,
 		 dev_name(&scmi_dev->dev), scmi_dev->protocol_id,
 		 scmi_dev->name);
 
@@ -474,9 +474,8 @@ __scmi_device_create(struct device_node *np, struct device *parent,
 	if (retval)
 		goto put_dev;
 
-	pr_debug("(%s) Created SCMI device '%s' for protocol 0x%x (%s)\n",
-		 of_node_full_name(parent->of_node),
-		 dev_name(&scmi_dev->dev), protocol, name);
+	pr_debug("(%pOF) Created SCMI device '%s' for protocol 0x%x (%s)\n",
+		 parent->of_node, dev_name(&scmi_dev->dev), protocol, name);
 
 	return scmi_dev;
 put_dev:
@@ -493,8 +492,8 @@ _scmi_device_create(struct device_node *np, struct device *parent,
 
 	sdev = __scmi_device_create(np, parent, protocol, name);
 	if (!sdev)
-		pr_err("(%s) Failed to create device for protocol 0x%x (%s)\n",
-		       of_node_full_name(parent->of_node), protocol, name);
+		pr_err("(%pOF) Failed to create device for protocol 0x%x (%s)\n",
+		       parent->of_node, protocol, name);
 
 	return sdev;
 }
diff --git a/drivers/firmware/arm_scmi/transports/mailbox.c b/drivers/firmware/arm_scmi/transports/mailbox.c
index bd041c99b92b..ae0f67e6cc45 100644
--- a/drivers/firmware/arm_scmi/transports/mailbox.c
+++ b/drivers/firmware/arm_scmi/transports/mailbox.c
@@ -127,8 +127,8 @@ static int mailbox_chan_validate(struct device *cdev, int *a2p_rx_chan,
 	    (num_mb == 1 && num_sh != 1) || (num_mb == 3 && num_sh != 2) ||
 	    (num_mb == 4 && num_sh != 2)) {
 		dev_warn(cdev,
-			 "Invalid channel descriptor for '%s' - mbs:%d  shm:%d\n",
-			 of_node_full_name(np), num_mb, num_sh);
+			 "Invalid channel descriptor for '%pOF' - mbs:%d  shm:%d\n",
+			 np, num_mb, num_sh);
 		return -EINVAL;
 	}
 
@@ -140,8 +140,7 @@ static int mailbox_chan_validate(struct device *cdev, int *a2p_rx_chan,
 					of_parse_phandle(np, "shmem", 1);
 
 		if (!np_tx || !np_rx || np_tx == np_rx) {
-			dev_warn(cdev, "Invalid shmem descriptor for '%s'\n",
-				 of_node_full_name(np));
+			dev_warn(cdev, "Invalid shmem descriptor for '%pOF'\n", np);
 			ret = -EINVAL;
 		}
 	}
-- 
2.48.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] firmware: arm_scmi: Simplify printks with pOF format
  2025-09-12  9:24 [PATCH] firmware: arm_scmi: Simplify printks with pOF format Krzysztof Kozlowski
@ 2025-09-12  9:34 ` Krzysztof Kozlowski
  2025-09-12 10:31   ` Sudeep Holla
  2025-09-12 11:19 ` Sudeep Holla
  1 sibling, 1 reply; 4+ messages in thread
From: Krzysztof Kozlowski @ 2025-09-12  9:34 UTC (permalink / raw)
  To: Sudeep Holla, Cristian Marussi, arm-scmi, linux-arm-kernel,
	linux-kernel

On 12/09/2025 11:24, Krzysztof Kozlowski wrote:
> Print full device node name with %pOF format, so the code will be a bit
> simpler.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  drivers/firmware/arm_scmi/bus.c                | 13 ++++++-------
>  drivers/firmware/arm_scmi/transports/mailbox.c |  7 +++----
>  2 files changed, 9 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
> index 24e59ddf85e7..c7698cfaa4e8 100644
> --- a/drivers/firmware/arm_scmi/bus.c
> +++ b/drivers/firmware/arm_scmi/bus.c
> @@ -401,8 +401,8 @@ static void scmi_device_release(struct device *dev)
>  
>  static void __scmi_device_destroy(struct scmi_device *scmi_dev)
>  {
> -	pr_debug("(%s) Destroying SCMI device '%s' for protocol 0x%x (%s)\n",
> -		 of_node_full_name(scmi_dev->dev.parent->of_node),
> +	pr_debug("(%pOF) Destroying SCMI device '%s' for protocol 0x%x (%s)\n",
> +		 scmi_dev->dev.parent->of_node,
>  		 dev_name(&scmi_dev->dev), scmi_dev->protocol_id,
>  		 scmi_dev->name);

Heh, I misread the docs and see now in the testing that my patch changes
the behavior. of_node_full_name() is just node name. pOF is full path.

This might be desired or not...

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] firmware: arm_scmi: Simplify printks with pOF format
  2025-09-12  9:34 ` Krzysztof Kozlowski
@ 2025-09-12 10:31   ` Sudeep Holla
  0 siblings, 0 replies; 4+ messages in thread
From: Sudeep Holla @ 2025-09-12 10:31 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Cristian Marussi, arm-scmi, Sudeep Holla, linux-arm-kernel,
	linux-kernel

On Fri, Sep 12, 2025 at 11:34:53AM +0200, Krzysztof Kozlowski wrote:
> On 12/09/2025 11:24, Krzysztof Kozlowski wrote:
> > Print full device node name with %pOF format, so the code will be a bit
> > simpler.
> > 
> > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > ---
> >  drivers/firmware/arm_scmi/bus.c                | 13 ++++++-------
> >  drivers/firmware/arm_scmi/transports/mailbox.c |  7 +++----
> >  2 files changed, 9 insertions(+), 11 deletions(-)
> > 
> > diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
> > index 24e59ddf85e7..c7698cfaa4e8 100644
> > --- a/drivers/firmware/arm_scmi/bus.c
> > +++ b/drivers/firmware/arm_scmi/bus.c
> > @@ -401,8 +401,8 @@ static void scmi_device_release(struct device *dev)
> >  
> >  static void __scmi_device_destroy(struct scmi_device *scmi_dev)
> >  {
> > -	pr_debug("(%s) Destroying SCMI device '%s' for protocol 0x%x (%s)\n",
> > -		 of_node_full_name(scmi_dev->dev.parent->of_node),
> > +	pr_debug("(%pOF) Destroying SCMI device '%s' for protocol 0x%x (%s)\n",
> > +		 scmi_dev->dev.parent->of_node,
> >  		 dev_name(&scmi_dev->dev), scmi_dev->protocol_id,
> >  		 scmi_dev->name);
> 
> Heh, I misread the docs and see now in the testing that my patch changes
> the behavior. of_node_full_name() is just node name. pOF is full path.
> 
> This might be desired or not...
> 

That should be fine. I am in the process of changing this but happy to
take this for now. We may have to move to fwnode as we are in process of
adding ACPI support for this. Not finalised yet so it may be a while before
I tinker with it again.

-- 
Regards,
Sudeep


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] firmware: arm_scmi: Simplify printks with pOF format
  2025-09-12  9:24 [PATCH] firmware: arm_scmi: Simplify printks with pOF format Krzysztof Kozlowski
  2025-09-12  9:34 ` Krzysztof Kozlowski
@ 2025-09-12 11:19 ` Sudeep Holla
  1 sibling, 0 replies; 4+ messages in thread
From: Sudeep Holla @ 2025-09-12 11:19 UTC (permalink / raw)
  To: Cristian Marussi, arm-scmi, linux-arm-kernel, linux-kernel,
	Krzysztof Kozlowski
  Cc: Sudeep Holla

On Fri, 12 Sep 2025 11:24:24 +0200, Krzysztof Kozlowski wrote:
> Print full device node name with %pOF format, so the code will be a bit
> simpler.
> 

Applied to sudeep.holla/linux (for-next/scmi/updates), thanks!

[1/1] firmware: arm_scmi: Simplify printks with pOF format
      https://git.kernel.org/sudeep.holla/c/2f86054cc1a6
--
Regards,
Sudeep



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-09-12 11:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-12  9:24 [PATCH] firmware: arm_scmi: Simplify printks with pOF format Krzysztof Kozlowski
2025-09-12  9:34 ` Krzysztof Kozlowski
2025-09-12 10:31   ` Sudeep Holla
2025-09-12 11:19 ` Sudeep Holla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox