From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Stanley Chang <stanley_chang@realtek.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
Douglas Anderson <dianders@chromium.org>,
Vincent Mailhol <mailhol.vincent@wanadoo.fr>,
Bhuvanesh Surachari <Bhuvanesh_Surachari@mentor.com>,
Mathias Nyman <mathias.nyman@linux.intel.com>,
Flavio Suligoi <f.suligoi@asem.it>, Ray Chi <raychi@google.com>,
Michael Grzeschik <m.grzeschik@pengutronix.de>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] usb: phy: add usb phy notify port status API
Date: Fri, 21 Apr 2023 10:21:08 +0200 [thread overview]
Message-ID: <ZEJHdCpLZ7f0946B@kroah.com> (raw)
In-Reply-To: <20230421080333.18681-1-stanley_chang@realtek.com>
On Fri, Apr 21, 2023 at 04:03:31PM +0800, Stanley Chang wrote:
> In Realtek SoC, the parameter of usb phy is designed to can dynamic
> tuning base on port status. Therefore, add a notify callback of phy
> driver when usb port status change.
>
> Signed-off-by: Stanley Chang <stanley_chang@realtek.com>
> ---
> drivers/usb/core/hub.c | 13 +++++++++++++
> include/linux/usb/phy.h | 14 ++++++++++++++
> 2 files changed, 27 insertions(+)
>
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index 97a0f8faea6e..b4fbbeae1927 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -614,6 +614,19 @@ static int hub_ext_port_status(struct usb_hub *hub, int port1, int type,
> ret = 0;
> }
> mutex_unlock(&hub->status_mutex);
> +
> + if (!ret) {
> + struct usb_device *hdev = hub->hdev;
> +
> + if (hdev && !hdev->parent) {
How can you have a device without a parent? And why does it matter?
And how could hdev be NULL? And if it can change to be NULL, what
prevents it from changing right after you checked for it?
thanks,
greg k-h
next prev parent reply other threads:[~2023-04-21 8:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-21 8:03 [PATCH v1] usb: phy: add usb phy notify port status API Stanley Chang
2023-04-21 8:19 ` Greg Kroah-Hartman
2023-04-21 8:32 ` Stanley Chang[昌育德]
2023-04-21 11:08 ` Greg Kroah-Hartman
2023-04-21 11:19 ` Stanley Chang[昌育德]
2023-04-21 8:21 ` Greg Kroah-Hartman [this message]
2023-04-21 8:40 ` Stanley Chang[昌育德]
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=ZEJHdCpLZ7f0946B@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=Bhuvanesh_Surachari@mentor.com \
--cc=dianders@chromium.org \
--cc=f.suligoi@asem.it \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=m.grzeschik@pengutronix.de \
--cc=mailhol.vincent@wanadoo.fr \
--cc=mathias.nyman@linux.intel.com \
--cc=raychi@google.com \
--cc=stanley_chang@realtek.com \
--cc=stern@rowland.harvard.edu \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox