Re: [PATCH] USB: chipidea: fix error path

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

 



On Thu, Dec 19, 2013 at 04:28:54PM +0800, Peter Chen wrote:
> On Thu, Dec 19, 2013 at 09:35:44AM +0100, Sascha Hauer wrote:
> > devm_usb_get_phy_by_phandle() returns a PTR_ERR on failure, so we have
> > to check for IS_ERR before calling usb_phy_shutdown(), not for NULL.
> > 
> > Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
> > Cc: Peter Chen <peter.chen@xxxxxxxxxxxxx>
> > Cc: linux-usb@xxxxxxxxxxxxxxx
> > ---
> >  drivers/usb/chipidea/ci_hdrc_imx.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
> > index be822a2..1b7ffc9 100644
> > --- a/drivers/usb/chipidea/ci_hdrc_imx.c
> > +++ b/drivers/usb/chipidea/ci_hdrc_imx.c
> > @@ -165,7 +165,7 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
> >  disable_device:
> >  	ci_hdrc_remove_device(data->ci_pdev);
> >  err_phy:
> > -	if (data->phy)
> > +	if (!IS_ERR(data->phy))
> >  		usb_phy_shutdown(data->phy);
> >  err_clk:
> >  	clk_disable_unprepare(data->clk);
> > @@ -179,7 +179,7 @@ static int ci_hdrc_imx_remove(struct platform_device *pdev)
> >  	pm_runtime_disable(&pdev->dev);
> >  	ci_hdrc_remove_device(data->ci_pdev);
> >  
> > -	if (data->phy)
> > +	if (!IS_ERR(data->phy))
> >  		usb_phy_shutdown(data->phy);
> >  
> >  	clk_disable_unprepare(data->clk);
> > -- 
> > 1.8.5.1
> > 
> 
> Sascha, thanks for your patch.
> 
> We have already moved PHY operation from glue layer to core, this
> patch may not be needed.

Ok, right. I missed these.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
--
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