On Tue, Feb 16, 2016 at 05:12:51PM +0800, Peter Chen wrote: > On Sat, Feb 06, 2016 at 10:57:06PM +0800, weiyj_lk@xxxxxxx wrote: > > From: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx> > > > > In case of error, the function usb_phy_generic_register() > > returns ERR_PTR() and never returns NULL. The NULL test in > > the return value check should be replaced with IS_ERR(). > > > > Signed-off-by: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx> > > --- > > drivers/usb/chipidea/ci_hdrc_pci.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/usb/chipidea/ci_hdrc_pci.c b/drivers/usb/chipidea/ci_hdrc_pci.c > > index b59195e..b635ab6 100644 > > --- a/drivers/usb/chipidea/ci_hdrc_pci.c > > +++ b/drivers/usb/chipidea/ci_hdrc_pci.c > > @@ -85,8 +85,8 @@ static int ci_hdrc_pci_probe(struct pci_dev *pdev, > > > > /* register a nop PHY */ > > ci->phy = usb_phy_generic_register(); > > - if (!ci->phy) > > - return -ENOMEM; > > + if (IS_ERR(ci->phy)) > > + return PTR_ERR(ci->phy); > > > > memset(res, 0, sizeof(res)); > > res[0].start = pci_resource_start(pdev, 0); > > > > The original code has several issues: > First, usb_phy_generic_register returns pointers of platform_device > Second, the generic USB PHY driver is related to struct usb_phy, but > not struct phy. > So, in this code, it needs to use ci->usb_phy to get the pointer > of struct usb_phy used at generic USB PHY driver. > > Would you mind sending the patches to fix them? > oops, The ci in this patch is struct ci_hdrc_pci *, but not struct ci_hdrc *. Your patch is ok, I will queue it, thanks. -- Best Regards, Peter Chen -- 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