Linux USB
 help / color / mirror / Atom feed
* [PATCH] usb: typec: ucsi: Fix printing of a fwnode with %pOFn
@ 2026-11-02  0:35 Asdlerto Korry
  2026-11-02  0:41 ` sashiko-bot
  2026-11-02  8:49 ` Konrad Dybcio
  0 siblings, 2 replies; 3+ messages in thread
From: Asdlerto Korry @ 2026-11-02  0:35 UTC (permalink / raw)
  To: Heikki Krogerus, Greg Kroah-Hartman
  Cc: Pengyu Luo, Dmitry Baryshkov, Neil Armstrong, Konrad Dybcio,
	linux-usb, linux-kernel, Asdlerto Korry

ucsi_glink and ucsi_huawei_gaokun walk the connector nodes with
device_for_each_child_node(), which yields a struct fwnode_handle, but
print it with %pOFn, which expects a struct device_node. vsprintf then
treats the fwnode_handle as a device_node and calls fwnode_get_name()
on a pointer into the middle of it, so the "missing reg property" error
path oopses instead of printing the message (seen with the same code in
pmic_glink_altmode on a Samsung Galaxy M52 5G).

Use %pfwP, the specifier for the name of a fwnode.

Fixes: c6165ed2f425 ("usb: ucsi: glink: use the connector orientation GPIO to provide switch events")
Fixes: 00327d7f2c8c ("usb: typec: ucsi: add Huawei Matebook E Go ucsi driver")
Signed-off-by: Asdlerto Korry <korryasdlerto@gmail.com>
---
 drivers/usb/typec/ucsi/ucsi_glink.c         | 2 +-
 drivers/usb/typec/ucsi/ucsi_huawei_gaokun.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/typec/ucsi/ucsi_glink.c b/drivers/usb/typec/ucsi/ucsi_glink.c
index 1db0c88d817e..4b4905624d61 100644
--- a/drivers/usb/typec/ucsi/ucsi_glink.c
+++ b/drivers/usb/typec/ucsi/ucsi_glink.c
@@ -433,7 +433,7 @@ static int pmic_glink_ucsi_probe(struct auxiliary_device *adev,
 
 		ret = fwnode_property_read_u32(fwnode, "reg", &port);
 		if (ret < 0) {
-			dev_err(dev, "missing reg property of %pOFn\n", fwnode);
+			dev_err(dev, "missing reg property of %pfwP\n", fwnode);
 			return ret;
 		}
 
diff --git a/drivers/usb/typec/ucsi/ucsi_huawei_gaokun.c b/drivers/usb/typec/ucsi/ucsi_huawei_gaokun.c
index 57b37fca150c..fc74c205181e 100644
--- a/drivers/usb/typec/ucsi/ucsi_huawei_gaokun.c
+++ b/drivers/usb/typec/ucsi/ucsi_huawei_gaokun.c
@@ -430,7 +430,7 @@ static int gaokun_ucsi_ports_init(struct gaokun_ucsi *uec)
 	device_for_each_child_node(dev, fwnode) {
 		ret = fwnode_property_read_u32(fwnode, "reg", &port);
 		if (ret < 0) {
-			dev_err(dev, "missing reg property of %pOFn\n", fwnode);
+			dev_err(dev, "missing reg property of %pfwP\n", fwnode);
 			fwnode_handle_put(fwnode);
 			return ret;
 		}
-- 
2.25.1


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

* Re: [PATCH] usb: typec: ucsi: Fix printing of a fwnode with %pOFn
  2026-11-02  0:35 [PATCH] usb: typec: ucsi: Fix printing of a fwnode with %pOFn Asdlerto Korry
@ 2026-11-02  0:41 ` sashiko-bot
  2026-11-02  8:49 ` Konrad Dybcio
  1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-11-02  0:41 UTC (permalink / raw)
  To: Asdlerto Korry; +Cc: linux-usb

> ucsi_glink and ucsi_huawei_gaokun walk the connector nodes with
> device_for_each_child_node(), which yields a struct fwnode_handle, but
> print it with %pOFn, which expects a struct device_node. vsprintf then
> treats the fwnode_handle as a device_node and calls fwnode_get_name()
> on a pointer into the middle of it, so the "missing reg property" error
> path oopses instead of printing the message (seen with the same code in
> pmic_glink_altmode on a Samsung Galaxy M52 5G).
> 
> Use %pfwP, the specifier for the name of a fwnode.
> 
> Fixes: c6165ed2f425 ("usb: ucsi: glink: use the connector orientation GPIO to provide switch events")
> Fixes: 00327d7f2c8c ("usb: typec: ucsi: add Huawei Matebook E Go ucsi driver")
> Signed-off-by: Asdlerto Korry <korryasdlerto@gmail.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261102003508.341309-1-korryasdlerto@gmail.com?part=1


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

* Re: [PATCH] usb: typec: ucsi: Fix printing of a fwnode with %pOFn
  2026-11-02  0:35 [PATCH] usb: typec: ucsi: Fix printing of a fwnode with %pOFn Asdlerto Korry
  2026-11-02  0:41 ` sashiko-bot
@ 2026-11-02  8:49 ` Konrad Dybcio
  1 sibling, 0 replies; 3+ messages in thread
From: Konrad Dybcio @ 2026-11-02  8:49 UTC (permalink / raw)
  To: Asdlerto Korry, Heikki Krogerus, Greg Kroah-Hartman
  Cc: Pengyu Luo, Dmitry Baryshkov, Neil Armstrong, linux-usb,
	linux-kernel

On 11/2/26 1:35 AM, Asdlerto Korry wrote:
> ucsi_glink and ucsi_huawei_gaokun walk the connector nodes with
> device_for_each_child_node(), which yields a struct fwnode_handle, but
> print it with %pOFn, which expects a struct device_node. vsprintf then
> treats the fwnode_handle as a device_node and calls fwnode_get_name()
> on a pointer into the middle of it, so the "missing reg property" error
> path oopses instead of printing the message (seen with the same code in
> pmic_glink_altmode on a Samsung Galaxy M52 5G).
> 
> Use %pfwP, the specifier for the name of a fwnode.
> 
> Fixes: c6165ed2f425 ("usb: ucsi: glink: use the connector orientation GPIO to provide switch events")
> Fixes: 00327d7f2c8c ("usb: typec: ucsi: add Huawei Matebook E Go ucsi driver")
> Signed-off-by: Asdlerto Korry <korryasdlerto@gmail.com>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad

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

end of thread, other threads:[~2026-11-02  8:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-02  0:35 [PATCH] usb: typec: ucsi: Fix printing of a fwnode with %pOFn Asdlerto Korry
2026-11-02  0:41 ` sashiko-bot
2026-11-02  8:49 ` Konrad Dybcio

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