Re: [PATCH 2/2] usb: core: phy: fix return value checking about devm_of_phy_get_by_index()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Chunfeng,

On Mon, Jun 25, 2018 at 8:37 AM Chunfeng Yun <chunfeng.yun@xxxxxxxxxxxx> wrote:
>
> On Sun, 2018-06-24 at 20:00 +0200, Martin Blumenstingl wrote:
> > Hello Chunfeng,
> >
> > thank you for the patch!
> >
> > On Fri, Jun 22, 2018 at 8:33 AM Chunfeng Yun <chunfeng.yun@xxxxxxxxxxxx> wrote:
> > >
> > > 1. use IS_ERR() but not IS_ERR_OR_NULL() because devm_of_phy_get_by_index()
> > >     never return NULL value;
> > ACK - good catch!
> >
> > > 2. devm_of_phy_get_by_index() should not fail for a valid index
> > I have learned that the PHY framework can return -ENODEV if the PHY is:
> > 1. supposed to be handled by the legacy USB PHY framework
> > 2. the PHY node is disabled in devicetree
> A little confused, we can avoid this error by not using a disabled or
> "usb-nop-xceiv" phy in host node.
I think that would be the mid or long term goal

> If ignore error of -ENODEV, we will also skip an error case which we
> don't want it happen.
as far as I understand the problem is that there are .dts files out
there which specify "usb-nop-xceiv" in the "phys" property, see [0]
(there might be even some more out-of-tree cases)
so I think the -ENODEV check can only be removed once nothing uses
"usb-nop-xceiv" anymore


Regards
Martin


[0] https://patchwork.kernel.org/patch/10160181/
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux