All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Akash Kumar" <akash.kumar@oss.qualcomm.com>
Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2 2/2] usb: typec: ucsi_ccg: Add CC orientation sensing via GPIO
Date: Mon, 23 Nov 2026 09:22:38 +0000	[thread overview]
Message-ID: <sashiko-outbox-228962@kernel.org> (raw)
In-Reply-To: <20261123091024.2214918-3-akash.kumar@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] usb: typec: ucsi_ccg: invalid %pOFn format for fwnode in
  ucsi_ccg_probe()
--

commit 0ee9b6d78660aaf0655e001e14913cd7b0e55e8e
Author: Akash Kumar <akash.kumar@oss.qualcomm.com>

usb: typec: ucsi_ccg: Add CC orientation sensing via GPIO

This commit adds optional per-connector CC orientation sensing via the
orientation-gpios property in ucsi_ccg_probe() and reports connector
orientation through update_connector and connector_status callbacks.

> diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
> index c560d45393024..06c536d876940 100644
> --- a/drivers/usb/typec/ucsi/ucsi_ccg.c
> +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c

[ ... ]

> @@ -1506,6 +1553,34 @@ static int ucsi_ccg_probe(struct i2c_client *client)
>  	if (uc->info.mode & CCG_DEVINFO_PDPORTS_MASK)
>  		uc->port_num++;
>  
> +	device_for_each_child_node_scoped(dev, fwnode) {
> +		struct gpio_desc *desc;
> +		u32 port;
> +
> +		status = fwnode_property_read_u32(fwnode, "reg", &port);
> +		if (status < 0) {
> +			dev_err(dev, "missing reg property of %pOFn\n", fwnode);
> +			return status;
> +		}

[Severity: Medium]
Should this format string use %pfwP instead of %pOFn for fwnode?

device_for_each_child_node_scoped() yields a struct fwnode_handle *, whereas
%pOFn expects a struct device_node * and applies of_fwnode_handle() to the
argument in device_node_string(), shifting the pointer by
offsetof(struct device_node, fwnode) and causing an invalid pointer
dereference if a child node lacks a reg property.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261123091024.2214918-1-akash.kumar@oss.qualcomm.com?part=2

  reply	other threads:[~2026-11-23  9:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23  9:10 [PATCH v2 0/2] usb: typec: ucsi_ccg: Add CC orientation sensing via GPIO Akash Kumar
2026-11-23  9:10 ` [PATCH v2 1/2] dt-bindings: usb: cypress,cypd4226: Add orientation-gpios property Akash Kumar
2026-11-23  9:18   ` sashiko-bot
2026-11-23 15:11   ` Rob Herring (Arm)
2026-11-23  9:10 ` [PATCH v2 2/2] usb: typec: ucsi_ccg: Add CC orientation sensing via GPIO Akash Kumar
2026-11-23  9:22   ` sashiko-bot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-11-17 14:09 [PATCH v2 0/2] usb: typec: ucsi_ccg: Add CC orientation-gpios support Akash Kumar
2026-11-17 14:09 ` [PATCH v2 2/2] usb: typec: ucsi_ccg: Add CC orientation sensing via GPIO Akash Kumar
2026-11-20 14:51   ` Heikki Krogerus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-228962@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=akash.kumar@oss.qualcomm.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.