From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin Blumenstingl Subject: Re: [PATCH 2/2] usb: core: phy: fix return value checking about devm_of_phy_get_by_index() Date: Mon, 25 Jun 2018 19:32:04 +0200 Message-ID: References: <4c338a129ab14ab41949da5e3c21aed0d77dff8d.1529647619.git.chunfeng.yun@mediatek.com> <644d00edd2932c1a0d0a1bf368dd25427d1d9f64.1529647619.git.chunfeng.yun@mediatek.com> <1529908621.32173.27.camel@mhfsdcap03> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <1529908621.32173.27.camel@mhfsdcap03> Sender: linux-kernel-owner@vger.kernel.org To: chunfeng.yun@mediatek.com Cc: johan@kernel.org, gregkh@linuxfoundation.org, felipe.balbi@linux.intel.com, matthias.bgg@gmail.com, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org List-Id: devicetree@vger.kernel.org Hi Chunfeng, On Mon, Jun 25, 2018 at 8:37 AM Chunfeng Yun 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 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/