All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Stanley Chang[昌育德]" <stanley_chang@realtek.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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-usb@vger.kernel.org>,
	"linux-kernel@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 08:40:05 +0000	[thread overview]
Message-ID: <fdf65c4eca9b420bb1ed29edb66482fb@realtek.com> (raw)
In-Reply-To: <ZEJHdCpLZ7f0946B@kroah.com>


> > 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?

If the hub is a root hub, the parent of hub will be NULL.
And we only send the port status to phy driver for root hub.
> 
> 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?
> 

It is right. hdev is never NULL, this is a redundant check.

Thanks,
Stanley

      reply	other threads:[~2023-04-21  8:40 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
2023-04-21  8:40   ` Stanley Chang[昌育德] [this message]

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=fdf65c4eca9b420bb1ed29edb66482fb@realtek.com \
    --to=stanley_chang@realtek.com \
    --cc=Bhuvanesh_Surachari@mentor.com \
    --cc=dianders@chromium.org \
    --cc=f.suligoi@asem.it \
    --cc=gregkh@linuxfoundation.org \
    --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=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 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.