Skip to content

Commit 26a6cc1

Browse files
zijun-hugregkh
authored andcommitted
usb: phy: Remove API devm_usb_put_phy()
Static devm_usb_phy_match() is only called by API devm_usb_put_phy(), and the API has no caller now. Remove the API and the static function. Signed-off-by: Zijun Hu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2eb3da0 commit 26a6cc1

File tree

3 files changed

+0
-32
lines changed

3 files changed

+0
-32
lines changed

Documentation/driver-api/driver-model/devres.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@ PHY
404404
devm_usb_get_phy()
405405
devm_usb_get_phy_by_node()
406406
devm_usb_get_phy_by_phandle()
407-
devm_usb_put_phy()
408407

409408
PINCTRL
410409
devm_pinctrl_get()

drivers/usb/phy/phy.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -346,13 +346,6 @@ static void devm_usb_phy_release2(struct device *dev, void *_res)
346346
usb_put_phy(res->phy);
347347
}
348348

349-
static int devm_usb_phy_match(struct device *dev, void *res, void *match_data)
350-
{
351-
struct usb_phy **phy = res;
352-
353-
return *phy == match_data;
354-
}
355-
356349
static void usb_charger_init(struct usb_phy *usb_phy)
357350
{
358351
usb_phy->chg_type = UNKNOWN_TYPE;
@@ -614,25 +607,6 @@ struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev,
614607
}
615608
EXPORT_SYMBOL_GPL(devm_usb_get_phy_by_phandle);
616609

617-
/**
618-
* devm_usb_put_phy - release the USB PHY
619-
* @dev: device that wants to release this phy
620-
* @phy: the phy returned by devm_usb_get_phy()
621-
*
622-
* destroys the devres associated with this phy and invokes usb_put_phy
623-
* to release the phy.
624-
*
625-
* For use by USB host and peripheral drivers.
626-
*/
627-
void devm_usb_put_phy(struct device *dev, struct usb_phy *phy)
628-
{
629-
int r;
630-
631-
r = devres_release(dev, devm_usb_phy_release, devm_usb_phy_match, phy);
632-
dev_WARN_ONCE(dev, r, "couldn't find PHY resource\n");
633-
}
634-
EXPORT_SYMBOL_GPL(devm_usb_put_phy);
635-
636610
/**
637611
* usb_put_phy - release the USB PHY
638612
* @x: the phy returned by usb_get_phy()

include/linux/usb/phy.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ extern struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev,
223223
extern struct usb_phy *devm_usb_get_phy_by_node(struct device *dev,
224224
struct device_node *node, struct notifier_block *nb);
225225
extern void usb_put_phy(struct usb_phy *);
226-
extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x);
227226
extern void usb_phy_set_event(struct usb_phy *x, unsigned long event);
228227
extern void usb_phy_set_charger_current(struct usb_phy *usb_phy,
229228
unsigned int mA);
@@ -259,10 +258,6 @@ static inline void usb_put_phy(struct usb_phy *x)
259258
{
260259
}
261260

262-
static inline void devm_usb_put_phy(struct device *dev, struct usb_phy *x)
263-
{
264-
}
265-
266261
static inline void usb_phy_set_event(struct usb_phy *x, unsigned long event)
267262
{
268263
}

0 commit comments

Comments
 (0)