Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <quic_zijuhu@quicinc.com>
Link: https://lore.kernel.org/r/20250112-remove_api-v1-1-49cc8f792ac9@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Zijun Hu and committed by
Greg Kroah-Hartman
26a6cc10 2eb3da03

-32
-1
Documentation/driver-api/driver-model/devres.rst
··· 404 404 devm_usb_get_phy() 405 405 devm_usb_get_phy_by_node() 406 406 devm_usb_get_phy_by_phandle() 407 - devm_usb_put_phy() 408 407 409 408 PINCTRL 410 409 devm_pinctrl_get()
-26
drivers/usb/phy/phy.c
··· 346 346 usb_put_phy(res->phy); 347 347 } 348 348 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 - 356 349 static void usb_charger_init(struct usb_phy *usb_phy) 357 350 { 358 351 usb_phy->chg_type = UNKNOWN_TYPE; ··· 606 613 return phy; 607 614 } 608 615 EXPORT_SYMBOL_GPL(devm_usb_get_phy_by_phandle); 609 - 610 - /** 611 - * devm_usb_put_phy - release the USB PHY 612 - * @dev: device that wants to release this phy 613 - * @phy: the phy returned by devm_usb_get_phy() 614 - * 615 - * destroys the devres associated with this phy and invokes usb_put_phy 616 - * to release the phy. 617 - * 618 - * For use by USB host and peripheral drivers. 619 - */ 620 - void devm_usb_put_phy(struct device *dev, struct usb_phy *phy) 621 - { 622 - int r; 623 - 624 - r = devres_release(dev, devm_usb_phy_release, devm_usb_phy_match, phy); 625 - dev_WARN_ONCE(dev, r, "couldn't find PHY resource\n"); 626 - } 627 - EXPORT_SYMBOL_GPL(devm_usb_put_phy); 628 616 629 617 /** 630 618 * usb_put_phy - release the USB PHY
-5
include/linux/usb/phy.h
··· 223 223 extern struct usb_phy *devm_usb_get_phy_by_node(struct device *dev, 224 224 struct device_node *node, struct notifier_block *nb); 225 225 extern void usb_put_phy(struct usb_phy *); 226 - extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x); 227 226 extern void usb_phy_set_event(struct usb_phy *x, unsigned long event); 228 227 extern void usb_phy_set_charger_current(struct usb_phy *usb_phy, 229 228 unsigned int mA); ··· 255 256 } 256 257 257 258 static inline void usb_put_phy(struct usb_phy *x) 258 - { 259 - } 260 - 261 - static inline void devm_usb_put_phy(struct device *dev, struct usb_phy *x) 262 259 { 263 260 } 264 261