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.

net: phy: remove unused fixup unregistering functions

No user of PHY fixups unregisters these. IOW: The fixup unregistering
functions are unused and can be removed. Remove also documentation
for these functions. Whilst at it, remove also mentioning of
phy_register_fixup() from the Documentation, as this function has been
static since ea47e70e476f ("net: phy: remove fixup-related definitions
from phy.h which are not used outside phylib").

Fixup unregistering functions were added with f38e7a32ee4f
("phy: add phy fixup unregister functions") in 2016, and last user
was removed with 6782d06a47ad ("net: usb: lan78xx: Remove KSZ9031 PHY
fixup") in 2024.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://patch.msgid.link/ff8ac321-435c-48d0-b376-fbca80c0c22e@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Heiner Kallweit and committed by
Jakub Kicinski
b1b77c82 acbe4a14

+1 -71
+1 -21
Documentation/networking/phy.rst
··· 524 524 with the fixup. This function is passed a pointer to the phy_device of 525 525 interest. It should therefore only operate on that PHY. 526 526 527 - The platform code can either register the fixup using phy_register_fixup():: 528 - 529 - int phy_register_fixup(const char *phy_id, 530 - u32 phy_uid, u32 phy_uid_mask, 531 - int (*run)(struct phy_device *)); 532 - 533 - Or using one of the two stubs, phy_register_fixup_for_uid() and 534 - phy_register_fixup_for_id():: 527 + The platform code can register the fixup using one of:: 535 528 536 529 int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask, 537 530 int (*run)(struct phy_device *)); 538 531 int phy_register_fixup_for_id(const char *phy_id, 539 532 int (*run)(struct phy_device *)); 540 - 541 - The stubs set one of the two matching criteria, and set the other one to 542 - match anything. 543 - 544 - When phy_register_fixup() or \*_for_uid()/\*_for_id() is called at module load 545 - time, the module needs to unregister the fixup and free allocated memory when 546 - it's unloaded. 547 - 548 - Call one of following function before unloading module:: 549 - 550 - int phy_unregister_fixup(const char *phy_id, u32 phy_uid, u32 phy_uid_mask); 551 - int phy_unregister_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask); 552 - int phy_register_fixup_for_id(const char *phy_id); 553 533 554 534 Standards 555 535 =========
-46
drivers/net/phy/phy_device.c
··· 475 475 } 476 476 EXPORT_SYMBOL(phy_register_fixup_for_id); 477 477 478 - /** 479 - * phy_unregister_fixup - remove a phy_fixup from the list 480 - * @bus_id: A string matches fixup->bus_id (or PHY_ANY_ID) in phy_fixup_list 481 - * @phy_uid: A phy id matches fixup->phy_id (or PHY_ANY_UID) in phy_fixup_list 482 - * @phy_uid_mask: Applied to phy_uid and fixup->phy_uid before comparison 483 - */ 484 - int phy_unregister_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask) 485 - { 486 - struct list_head *pos, *n; 487 - struct phy_fixup *fixup; 488 - int ret; 489 - 490 - ret = -ENODEV; 491 - 492 - mutex_lock(&phy_fixup_lock); 493 - list_for_each_safe(pos, n, &phy_fixup_list) { 494 - fixup = list_entry(pos, struct phy_fixup, list); 495 - 496 - if ((!strcmp(fixup->bus_id, bus_id)) && 497 - phy_id_compare(fixup->phy_uid, phy_uid, phy_uid_mask)) { 498 - list_del(&fixup->list); 499 - kfree(fixup); 500 - ret = 0; 501 - break; 502 - } 503 - } 504 - mutex_unlock(&phy_fixup_lock); 505 - 506 - return ret; 507 - } 508 - EXPORT_SYMBOL(phy_unregister_fixup); 509 - 510 - /* Unregisters a fixup of any PHY with the UID in phy_uid */ 511 - int phy_unregister_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask) 512 - { 513 - return phy_unregister_fixup(PHY_ANY_ID, phy_uid, phy_uid_mask); 514 - } 515 - EXPORT_SYMBOL(phy_unregister_fixup_for_uid); 516 - 517 - /* Unregisters a fixup of the PHY with id string bus_id */ 518 - int phy_unregister_fixup_for_id(const char *bus_id) 519 - { 520 - return phy_unregister_fixup(bus_id, PHY_ANY_UID, 0xffffffff); 521 - } 522 - EXPORT_SYMBOL(phy_unregister_fixup_for_id); 523 - 524 478 /* Returns 1 if fixup matches phydev in bus_id and phy_uid. 525 479 * Fixups can be set to match any in one or more fields. 526 480 */
-4
include/linux/phy.h
··· 2405 2405 int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask, 2406 2406 int (*run)(struct phy_device *)); 2407 2407 2408 - int phy_unregister_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask); 2409 - int phy_unregister_fixup_for_id(const char *bus_id); 2410 - int phy_unregister_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask); 2411 - 2412 2408 int phy_eee_tx_clock_stop_capable(struct phy_device *phydev); 2413 2409 int phy_eee_rx_clock_stop(struct phy_device *phydev, bool clk_stop_enable); 2414 2410 int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable);