Hi, On Fri, Jun 1, 2012 at 6:36 AM, Chen Peter-B29397 <B29397@xxxxxxxxxxxxx> wrote: > >> >> >> >> Used devres API's to associate the phy with a device so that on >> >> driver detach, release function is invoked on the devres data(usb_phy) >> >> and devres data(usb_phy) is released. >> > If the phy is got by two devices (like otg and device), will it cause >> any >> > problems? >> >> No. In that case the phy will be just associated with two devices >> (because devm_usb_get_phy will be called twice) and on driver detach, >> usb_put_phy will be called twice (corresponding to each driver that >> called devm_usb_get_phy). Do you suspect of any problems? >> > So the devm_usb_phy_release will only be called when last phy user's detach? No. It will be called for every user's (device) detach. Thats how you'll have a usb_put_phy() corresponding to every usb_get_phy(). (Pls have a look inside of devm_usb_get_phy() and devm_usb_phy_release()). devm_usb_phy_release _DOES NOT_ do a usb_remove_phy, if that was your concern :-) Thanks Kishon -- 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