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.

Merge branch 'net-phy-clean-up-phy-package-mmd-access-functions'

Heiner Kallweit says:

====================
net: phy: clean up PHY package MMD access functions

Move declarations of the functions with users to phylib.h, and remove
unused functions.
====================

Link: https://patch.msgid.link/b624fcb7-b493-461a-a0b5-9ca7e9d767bc@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

+6 -91
-75
drivers/net/phy/phy-core.c
··· 735 735 EXPORT_SYMBOL(__phy_package_read_mmd); 736 736 737 737 /** 738 - * phy_package_read_mmd - read MMD reg relative to PHY package base addr 739 - * @phydev: The phy_device struct 740 - * @addr_offset: The offset to be added to PHY package base_addr 741 - * @devad: The MMD to read from 742 - * @regnum: The register on the MMD to read 743 - * 744 - * Convenience helper for reading a register of an MMD on a given PHY 745 - * using the PHY package base address. The base address is added to 746 - * the addr_offset value. 747 - * 748 - * Same calling rules as for phy_read(); 749 - * 750 - * NOTE: It's assumed that the entire PHY package is either C22 or C45. 751 - */ 752 - int phy_package_read_mmd(struct phy_device *phydev, 753 - unsigned int addr_offset, int devad, 754 - u32 regnum) 755 - { 756 - int addr = phy_package_address(phydev, addr_offset); 757 - int val; 758 - 759 - if (addr < 0) 760 - return addr; 761 - 762 - if (regnum > (u16)~0 || devad > 32) 763 - return -EINVAL; 764 - 765 - phy_lock_mdio_bus(phydev); 766 - val = mmd_phy_read(phydev->mdio.bus, addr, phydev->is_c45, devad, 767 - regnum); 768 - phy_unlock_mdio_bus(phydev); 769 - 770 - return val; 771 - } 772 - EXPORT_SYMBOL(phy_package_read_mmd); 773 - 774 - /** 775 738 * __phy_package_write_mmd - write MMD reg relative to PHY package base addr 776 739 * @phydev: The phy_device struct 777 740 * @addr_offset: The offset to be added to PHY package base_addr ··· 766 803 regnum, val); 767 804 } 768 805 EXPORT_SYMBOL(__phy_package_write_mmd); 769 - 770 - /** 771 - * phy_package_write_mmd - write MMD reg relative to PHY package base addr 772 - * @phydev: The phy_device struct 773 - * @addr_offset: The offset to be added to PHY package base_addr 774 - * @devad: The MMD to write to 775 - * @regnum: The register on the MMD to write 776 - * @val: value to write to @regnum 777 - * 778 - * Convenience helper for writing a register of an MMD on a given PHY 779 - * using the PHY package base address. The base address is added to 780 - * the addr_offset value. 781 - * 782 - * Same calling rules as for phy_write(); 783 - * 784 - * NOTE: It's assumed that the entire PHY package is either C22 or C45. 785 - */ 786 - int phy_package_write_mmd(struct phy_device *phydev, 787 - unsigned int addr_offset, int devad, 788 - u32 regnum, u16 val) 789 - { 790 - int addr = phy_package_address(phydev, addr_offset); 791 - int ret; 792 - 793 - if (addr < 0) 794 - return addr; 795 - 796 - if (regnum > (u16)~0 || devad > 32) 797 - return -EINVAL; 798 - 799 - phy_lock_mdio_bus(phydev); 800 - ret = mmd_phy_write(phydev->mdio.bus, addr, phydev->is_c45, devad, 801 - regnum, val); 802 - phy_unlock_mdio_bus(phydev); 803 - 804 - return ret; 805 - } 806 - EXPORT_SYMBOL(phy_package_write_mmd); 807 806 808 807 /** 809 808 * phy_modify_changed - Function for modifying a PHY register
+6
drivers/net/phy/phylib.h
··· 15 15 u32 regnum); 16 16 int __phy_package_write(struct phy_device *phydev, unsigned int addr_offset, 17 17 u32 regnum, u16 val); 18 + int __phy_package_read_mmd(struct phy_device *phydev, 19 + unsigned int addr_offset, int devad, 20 + u32 regnum); 21 + int __phy_package_write_mmd(struct phy_device *phydev, 22 + unsigned int addr_offset, int devad, 23 + u32 regnum, u16 val); 18 24 bool phy_package_init_once(struct phy_device *phydev); 19 25 bool phy_package_probe_once(struct phy_device *phydev); 20 26 int phy_package_join(struct phy_device *phydev, int base_addr, size_t priv_size);
-16
include/linux/phy.h
··· 2107 2107 struct kernel_hwtstamp_config *config, 2108 2108 struct netlink_ext_ack *extack); 2109 2109 2110 - int __phy_package_read_mmd(struct phy_device *phydev, 2111 - unsigned int addr_offset, int devad, 2112 - u32 regnum); 2113 - 2114 - int phy_package_read_mmd(struct phy_device *phydev, 2115 - unsigned int addr_offset, int devad, 2116 - u32 regnum); 2117 - 2118 - int __phy_package_write_mmd(struct phy_device *phydev, 2119 - unsigned int addr_offset, int devad, 2120 - u32 regnum, u16 val); 2121 - 2122 - int phy_package_write_mmd(struct phy_device *phydev, 2123 - unsigned int addr_offset, int devad, 2124 - u32 regnum, u16 val); 2125 - 2126 2110 extern const struct bus_type mdio_bus_type; 2127 2111 2128 2112 struct mdio_board_info {