diff options
| author | Kishon Vijay Abraham I <kishon@ti.com> | 2012-06-22 07:32:47 -0400 |
|---|---|---|
| committer | Felipe Balbi <balbi@ti.com> | 2012-06-25 07:06:16 -0400 |
| commit | 410219dcd2ba8d8b4bcfa9c232f35bf505bc021a (patch) | |
| tree | 6aadab913c25bf86763649907a2d4ec0b9fa1582 /include/linux | |
| parent | 662dca54ca67c92b7aa14b9a2ec54acacf33ce45 (diff) | |
usb: otg: utils: devres: Add API's to associate a device with the phy
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.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/usb/otg.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 1def65fb57d0..0cb2ec2e50c0 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
| @@ -185,7 +185,10 @@ usb_phy_shutdown(struct usb_phy *x) | |||
| 185 | /* for usb host and peripheral controller drivers */ | 185 | /* for usb host and peripheral controller drivers */ |
| 186 | #ifdef CONFIG_USB_OTG_UTILS | 186 | #ifdef CONFIG_USB_OTG_UTILS |
| 187 | extern struct usb_phy *usb_get_phy(enum usb_phy_type type); | 187 | extern struct usb_phy *usb_get_phy(enum usb_phy_type type); |
| 188 | extern struct usb_phy *devm_usb_get_phy(struct device *dev, | ||
| 189 | enum usb_phy_type type); | ||
| 188 | extern void usb_put_phy(struct usb_phy *); | 190 | extern void usb_put_phy(struct usb_phy *); |
| 191 | extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x); | ||
| 189 | extern const char *otg_state_string(enum usb_otg_state state); | 192 | extern const char *otg_state_string(enum usb_otg_state state); |
| 190 | #else | 193 | #else |
| 191 | static inline struct usb_phy *usb_get_phy(enum usb_phy_type type) | 194 | static inline struct usb_phy *usb_get_phy(enum usb_phy_type type) |
| @@ -193,10 +196,20 @@ static inline struct usb_phy *usb_get_phy(enum usb_phy_type type) | |||
| 193 | return NULL; | 196 | return NULL; |
| 194 | } | 197 | } |
| 195 | 198 | ||
| 199 | static inline struct usb_phy *devm_usb_get_phy(struct device *dev, | ||
| 200 | enum usb_phy_type type) | ||
| 201 | { | ||
| 202 | return NULL; | ||
| 203 | } | ||
| 204 | |||
| 196 | static inline void usb_put_phy(struct usb_phy *x) | 205 | static inline void usb_put_phy(struct usb_phy *x) |
| 197 | { | 206 | { |
| 198 | } | 207 | } |
| 199 | 208 | ||
| 209 | static inline void devm_usb_put_phy(struct device *dev, struct usb_phy *x) | ||
| 210 | { | ||
| 211 | } | ||
| 212 | |||
| 200 | static inline const char *otg_state_string(enum usb_otg_state state) | 213 | static inline const char *otg_state_string(enum usb_otg_state state) |
| 201 | { | 214 | { |
| 202 | return NULL; | 215 | return NULL; |
