RE: [PATCH v7 1/5] usb: phy: add usb phy notify port status API

From: Stanley Chang[昌育德]
Date: Mon Jul 24 2023 - 04:47:18 EST


Hi Greg,

> > > > > +
> > > > > + if (!ret) {
> > > > > + struct usb_device *hdev = hub->hdev;
> > > > > +
> > > > > + if (hdev && !hdev->parent) {
> > > >
> > > > Why the check for no parent? Please document that here in a
> comment.
> > >
> > > I will add a comment :
> > > /* Only notify roothub. That is, when hdev->parent is empty. */
> >
> > Also document this that this will only happen for root hub status
> > changes, that's not obvious in the callback name or documentation or
> anywhere else here.
>
> All usb phy notifications (connection, disconnection) are only for roothub.
> So I don't special to doc this.

I will add the comment:
/*
* Applies to roothub only. That is, when hdev->parent is
* empty. Only the roothub will be notified of port state
* changes, since the USB PHY only cares about changes at
* the next level.
*/


Thanks,
Stanley