Hi,

Peter Chen writes:
> On Wed, Jul 31, 2013 at 04:21:14PM +0200, Lothar Waßmann wrote:
> > This prevents the USB PHY refcount to be decremented below zero upon
> > unloading the ci-hdrc-imx module.
> > 
> > Signed-off-by: Lothar Waßmann <l...@karo-electronics.de>
> > ---
> >  drivers/usb/chipidea/ci_hdrc_imx.c |    4 +---
> >  1 files changed, 1 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c 
> > b/drivers/usb/chipidea/ci_hdrc_imx.c
> > index 14362c0..802eab1 100644
> > --- a/drivers/usb/chipidea/ci_hdrc_imx.c
> > +++ b/drivers/usb/chipidea/ci_hdrc_imx.c
> > @@ -218,10 +218,8 @@ static int ci_hdrc_imx_remove(struct platform_device 
> > *pdev)
> >     if (data->reg_vbus)
> >             regulator_disable(data->reg_vbus);
> >  
> > -   if (data->phy) {
> > +   if (data->phy)
> >             usb_phy_shutdown(data->phy);
> > -           module_put(data->phy->dev->driver->owner);
> > -   }
> >  
> >     clk_disable_unprepare(data->clk);
> 
> Have you met warning? devm_usb_get_phy_by_phandle at probe calls
> try_module_get.
> 
Since it is a 'devm_*' function I would vouch that it also takes care
of the module_put() automagically.

Just try loading and unloading the ci-hdrc-imx module and look at the
resulting refcount of the mxs_usb_phy module.

refcounting is OK without the module_put() here.


Lothar Waßmann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | i...@karo-electronics.de
___________________________________________________________
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to