net: phy: clean up phy.h
Subsystems (3)
Heiner Kallweit
maintainercover net: phy: clean up phy.h
This series is a starting point to clean up phy.h and remove definitions which are phylib-internal.
Heiner Kallweit (4):
net: phy: remove fixup-related definitions from phy.h which are not
used outside phylib
net: phy: stop exporting feature arrays which aren't used outside
phylib
net: phy: stop exporting phy_queue_state_machine
net: phy: remove helper phy_is_internal
drivers/net/phy/phy.c | 6 +++--- drivers/net/phy/phy_device.c | 40 ++++++++++++++++++------------------ include/linux/phy.h | 29 -------------------------- 3 files changed, 23 insertions(+), 52 deletions(-)
Signature · 1 line
2.48.1
Heiner Kallweit
maintainerPATCH 1/4 net: phy: remove fixup-related definitions from phy.h which are not used outside phylib
Certain fixup-related definitions aren't used outside phy_device.c. So make them private and remove them from phy.h.
--- drivers/net/phy/phy_device.c | 16 +++++++++++++--- include/linux/phy.h | 14 -------------- 2 files changed, 13 insertions(+), 17 deletions(-)
drivers/net/phy/phy_device.c +13 -3
@@ -45,6 +45,17 @@ MODULE_DESCRIPTION("PHY library");MODULE_AUTHOR ("Andy Fleming" );MODULE_LICENSE ("GPL" ); +#define PHY_ANY_ID "MATCH ANY PHY" +#define PHY_ANY_UID 0xffffffff + +struct phy_fixup { +struct list_head list; +char bus_id[MII_BUS_ID_SIZE +3 ]; +u32 phy_uid; +u32 phy_uid_mask; +int (*run)(struct phy_device *phydev); +}; +__ETHTOOL_DECLARE_LINK_MODE_MASK (phy_basic_features)__ro_after_init ;EXPORT_SYMBOL_GPL (phy_basic_features);
@@ -378,8 +389,8 @@ static SIMPLE_DEV_PM_OPS(mdio_bus_phy_pm_ops, mdio_bus_phy_suspend,* comparison * @run: The actual code to be run when a matching PHY is found */ -int phy_register_fixup (const char *bus_id,u32 phy_uid,u32 phy_uid_mask, -int (*run)(struct phy_device *)) +static int phy_register_fixup (const char *bus_id,u32 phy_uid,u32 phy_uid_mask, +int (*run)(struct phy_device *)) {struct phy_fixup *fixup =kzalloc (sizeof (*fixup),GFP_KERNEL );
@@ -397,7 +408,6 @@ int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,return 0 ; } -EXPORT_SYMBOL (phy_register_fixup);/* Registers a fixup to be run on any PHY with the UID in phy_uid */ int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask,
include/linux/phy.h +0 -14
@@ -1277,9 +1277,6 @@ struct phy_driver {#define to_phy_driver (d) container_of_const(to_mdio_common_driver(d), \ struct phy_driver, mdiodrv) -#define PHY_ANY_ID "MATCH ANY PHY" -#define PHY_ANY_UID 0xffffffff -#define PHY_ID_MATCH_EXACT (id) .phy_id = (id), .phy_id_mask = GENMASK(31, 0)#define PHY_ID_MATCH_MODEL (id) .phy_id = (id), .phy_id_mask = GENMASK(31, 4)#define PHY_ID_MATCH_VENDOR (id) .phy_id = (id), .phy_id_mask = GENMASK(31, 10)
@@ -1312,15 +1309,6 @@ static inline bool phydev_id_compare(struct phy_device *phydev, u32 id)return phy_id_compare (id, phydev->phy_id, phydev->drv->phy_id_mask); } -/* A Structure for boards to register fixups with the PHY Lib */ -struct phy_fixup { -struct list_head list; -char bus_id[MII_BUS_ID_SIZE +3 ]; -u32 phy_uid; -u32 phy_uid_mask; -int (*run)(struct phy_device *phydev); -}; -const char *phy_speed_to_str (int speed);const char *phy_duplex_to_str (unsigned int duplex);const char *phy_rate_matching_to_str (int rate_matching);
@@ -2117,8 +2105,6 @@ s32 phy_get_internal_delay(struct phy_device *phydev, struct device *dev,void phy_resolve_pause (unsigned long *local_adv,unsigned long *partner_adv,bool *tx_pause,bool *rx_pause); -int phy_register_fixup (const char *bus_id,u32 phy_uid,u32 phy_uid_mask, -int (*run)(struct phy_device *));int phy_register_fixup_for_id (const char *bus_id,int (*run)(struct phy_device *)); int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask,
Signature · 1 line
2.48.1
Heiner Kallweit
maintainerPATCH 2/4 net: phy: stop exporting feature arrays which aren't used outside phylib
In reply to Heiner KallweitStop exporting feature arrays which aren't used outside phylib.
--- drivers/net/phy/phy_device.c | 22 ++++++---------------- include/linux/phy.h | 5 ----- 2 files changed, 6 insertions(+), 21 deletions(-)
drivers/net/phy/phy_device.c +6 -16
@@ -91,37 +91,28 @@ static const int phy_all_ports_features_array[7] = { ETHTOOL_LINK_MODE_Backplane_BIT, }; -const int phy_10_100_features_array[4 ] = { +static const int phy_10_100_features_array[4 ] = { ETHTOOL_LINK_MODE_10baseT_Half_BIT, ETHTOOL_LINK_MODE_10baseT_Full_BIT, ETHTOOL_LINK_MODE_100baseT_Half_BIT, ETHTOOL_LINK_MODE_100baseT_Full_BIT, }; -EXPORT_SYMBOL_GPL (phy_10_100_features_array); -const int phy_basic_t1_features_array[3 ] = { +static const int phy_basic_t1_features_array[3 ] = {ETHTOOL_LINK_MODE_TP_BIT , ETHTOOL_LINK_MODE_10baseT1L_Full_BIT, ETHTOOL_LINK_MODE_100baseT1_Full_BIT, }; -EXPORT_SYMBOL_GPL (phy_basic_t1_features_array); -const int phy_basic_t1s_p2mp_features_array[2 ] = { +static const int phy_basic_t1s_p2mp_features_array[2 ] = {ETHTOOL_LINK_MODE_TP_BIT , ETHTOOL_LINK_MODE_10baseT1S_P2MP_Half_BIT, }; -EXPORT_SYMBOL_GPL (phy_basic_t1s_p2mp_features_array); -const int phy_gbit_features_array[2 ] = { +static const int phy_gbit_features_array[2 ] = { ETHTOOL_LINK_MODE_1000baseT_Half_BIT, ETHTOOL_LINK_MODE_1000baseT_Full_BIT, }; -EXPORT_SYMBOL_GPL (phy_gbit_features_array); - -const int phy_10gbit_features_array[1 ] = { - ETHTOOL_LINK_MODE_10000baseT_Full_BIT, -}; -EXPORT_SYMBOL_GPL (phy_10gbit_features_array);static const int phy_eee_cap1_features_array[] = { ETHTOOL_LINK_MODE_100baseT_Full_BIT,
@@ -196,9 +187,8 @@ static void features_init(void)linkmode_set_bit_array (phy_gbit_features_array,ARRAY_SIZE (phy_gbit_features_array), phy_10gbit_features); -linkmode_set_bit_array (phy_10gbit_features_array, -ARRAY_SIZE (phy_10gbit_features_array), - phy_10gbit_features); +linkmode_set_bit (ETHTOOL_LINK_MODE_10000baseT_Full_BIT, + phy_10gbit_features); linkmode_set_bit_array(phy_eee_cap1_features_array, ARRAY_SIZE(phy_eee_cap1_features_array),
include/linux/phy.h +0 -5
@@ -54,11 +54,6 @@ extern __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_eee_cap2_features) __ro_after_init;#define PHY_EEE_CAP2_FEATURES ((unsigned long *)&phy_eee_cap2_features)extern const int phy_basic_ports_array[3 ]; -extern const int phy_10_100_features_array[4 ]; -extern const int phy_basic_t1_features_array[3 ]; -extern const int phy_basic_t1s_p2mp_features_array[2 ]; -extern const int phy_gbit_features_array[2 ]; -extern const int phy_10gbit_features_array[1 ];/* * Set phydev->irq to PHY_POLL if interrupts are not supported,
Signature · 1 line
2.48.1
Heiner Kallweit
maintainerPATCH 3/4 net: phy: stop exporting phy_queue_state_machine
In reply to Heiner Kallweitphy_queue_state_machine() isn't used outside phy.c, so stop exporting it.
--- drivers/net/phy/phy.c | 4 ++-- include/linux/phy.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/net/phy/phy.c +2 -2
@@ -520,12 +520,12 @@ int __phy_hwtstamp_set(struct phy_device *phydev,* @phydev: the phy_device struct * @jiffies: Run the state machine after these jiffies */ -void phy_queue_state_machine (struct phy_device *phydev,unsigned long jiffies) +static void phy_queue_state_machine (struct phy_device *phydev, +unsigned long jiffies) {mod_delayed_work (system_power_efficient_wq, &phydev->state_queue, jiffies); } -EXPORT_SYMBOL (phy_queue_state_machine);/** * phy_trigger_machine - Trigger the state machine to run now
include/linux/phy.h +0 -1
@@ -2061,7 +2061,6 @@ int phy_drivers_register(struct phy_driver *new_driver, int n, struct module *owner);void phy_error (struct phy_device *phydev);void phy_state_machine (struct work_struct *work); -void phy_queue_state_machine (struct phy_device *phydev,unsigned long jiffies);void phy_trigger_machine (struct phy_device *phydev);void phy_mac_interrupt (struct phy_device *phydev);void phy_start_machine (struct phy_device *phydev);
Signature · 1 line
2.48.1
Heiner Kallweit
maintainerPATCH 4/4 net: phy: remove helper phy_is_internal
In reply to Heiner KallweitHelper phy_is_internal() is just used in two places phylib-internally. So let's remove it from the API.
--- drivers/net/phy/phy.c | 2 +- drivers/net/phy/phy_device.c | 2 +- include/linux/phy.h | 9 --------- 3 files changed, 2 insertions(+), 11 deletions(-)
drivers/net/phy/phy.c +1 -1
@@ -302,7 +302,7 @@ void phy_ethtool_ksettings_get(struct phy_device *phydev, cmd->base.port =PORT_BNC ; else cmd->base.port = phydev->port; - cmd->base.transceiver =phy_is_internal (phydev) ? + cmd->base.transceiver = phydev->is_internal ?XCVR_INTERNAL :XCVR_EXTERNAL ; cmd->base.phy_address = phydev->mdio.addr; cmd->base.autoneg = phydev->autoneg;
drivers/net/phy/phy_device.c +1 -1
@@ -544,7 +544,7 @@ phy_interface_show(struct device *dev, struct device_attribute *attr, char *buf)struct phy_device *phydev =to_phy_device (dev);const char *mode =NULL ; -if (phy_is_internal (phydev)) +if (phydev->is_internal) mode ="internal" ;else mode =phy_modes (phydev->interface);
include/linux/phy.h +0 -9
@@ -1729,15 +1729,6 @@ static inline bool phy_is_default_hwtstamp(struct phy_device *phydev)return phy_has_hwtstamp (phydev) && phydev->default_timestamp; } -/** -* phy_is_internal - Convenience function for testing if a PHY is internal -* @phydev: the phy_device struct -*/ -static inline bool phy_is_internal (struct phy_device *phydev) -{ -return phydev->is_internal; -} -/** * phy_on_sfp - Convenience function for testing if a PHY is on an SFP module * @phydev: the phy_device struct
Signature · 1 line
2.48.1
Re: [PATCH net-next 1/4] net: phy: remove fixup-related definitions from phy.h which are not used outside phylib
In reply to Heiner KallweitQuoted 14 lines · Heiner Kallweit
Certain fixup-related definitions aren't used outside
phy_device.c. So make them private and remove them fromphy.h.Signed-off-by Heiner Kallweit <[email protected]>--- drivers/net/phy/phy_device.c | 16 +++++++++++++--- include/linux/phy.h | 14 -------------- 2 files changed, 13 insertions(+), 17 deletions(-)drivers/net/phy/phy_device.c +0
-0
drivers/net/phy/phy_device.c MODULE_DESCRIPTION("PHY library"); · line 50
Quoted 6 lines
drivers/net/phy/phy_device.c +3
-0@@ -45,6 +45,17 @@ MODULE_DESCRIPTION("PHY library");MODULE_AUTHOR ("Andy Fleming" );MODULE_LICENSE ("GPL" ); +#define PHY_ANY_ID "MATCH ANY PHY" +#define PHY_ANY_UID 0xffffffff +
Overall looks like a nice cleanup but I am not sure about this space between #define and PHY_ANY_ID or PHY_ANY_UID...
Quoted 69 lines
drivers/net/phy/phy_device.c +10
-3+struct phy_fixup { +struct list_head list; +char bus_id[MII_BUS_ID_SIZE +3 ]; +u32 phy_uid; +u32 phy_uid_mask; +int (*run)(struct phy_device *phydev); +}; +__ETHTOOL_DECLARE_LINK_MODE_MASK (phy_basic_features)__ro_after_init ;EXPORT_SYMBOL_GPL (phy_basic_features);@@ -378,8 +389,8 @@ static SIMPLE_DEV_PM_OPS(mdio_bus_phy_pm_ops, mdio_bus_phy_suspend,* comparison * @run: The actual code to be run when a matching PHY is found */ -int phy_register_fixup (const char *bus_id,u32 phy_uid,u32 phy_uid_mask, -int (*run)(struct phy_device *)) +static int phy_register_fixup (const char *bus_id,u32 phy_uid,u32 phy_uid_mask, +int (*run)(struct phy_device *)) {struct phy_fixup *fixup =kzalloc (sizeof (*fixup),GFP_KERNEL );@@ -397,7 +408,6 @@ int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,return 0 ; } -EXPORT_SYMBOL (phy_register_fixup);/* Registers a fixup to be run on any PHY with the UID in phy_uid */ int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask,include/linux/phy.h +0
-14@@ -1277,9 +1277,6 @@ struct phy_driver {#define to_phy_driver (d) container_of_const(to_mdio_common_driver(d), \ struct phy_driver, mdiodrv) -#define PHY_ANY_ID "MATCH ANY PHY" -#define PHY_ANY_UID 0xffffffff -#define PHY_ID_MATCH_EXACT (id) .phy_id = (id), .phy_id_mask = GENMASK(31, 0)#define PHY_ID_MATCH_MODEL (id) .phy_id = (id), .phy_id_mask = GENMASK(31, 4)#define PHY_ID_MATCH_VENDOR (id) .phy_id = (id), .phy_id_mask = GENMASK(31, 10)@@ -1312,15 +1309,6 @@ static inline bool phydev_id_compare(struct phy_device *phydev, u32 id)return phy_id_compare (id, phydev->phy_id, phydev->drv->phy_id_mask); } -/* A Structure for boards to register fixups with the PHY Lib */ -struct phy_fixup { -struct list_head list; -char bus_id[MII_BUS_ID_SIZE +3 ]; -u32 phy_uid; -u32 phy_uid_mask; -int (*run)(struct phy_device *phydev); -}; -const char *phy_speed_to_str (int speed);const char *phy_duplex_to_str (unsigned int duplex);const char *phy_rate_matching_to_str (int rate_matching);@@ -2117,8 +2105,6 @@ s32 phy_get_internal_delay(struct phy_device *phydev, struct device *dev,void phy_resolve_pause (unsigned long *local_adv,unsigned long *partner_adv,bool *tx_pause,bool *rx_pause); -int phy_register_fixup (const char *bus_id,u32 phy_uid,u32 phy_uid_mask, -int (*run)(struct phy_device *));int phy_register_fixup_for_id (const char *bus_id,int (*run)(struct phy_device *)); int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask,
Re: [PATCH net-next 3/4] net: phy: stop exporting phy_queue_state_machine
In reply to Heiner KallweitQuoted 33 lines · Heiner Kallweit
phy_queue_state_machine()isn't used outsidephy.c, so stop exporting it.Signed-off-by Heiner Kallweit <[email protected]>--- drivers/net/phy/phy.c | 4 ++-- include/linux/phy.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-)drivers/net/phy/phy.c +2
-2@@ -520,12 +520,12 @@ int __phy_hwtstamp_set(struct phy_device *phydev,* @phydev: the phy_device struct * @jiffies: Run the state machine after these jiffies */ -void phy_queue_state_machine (struct phy_device *phydev,unsigned long jiffies) +static void phy_queue_state_machine (struct phy_device *phydev, +unsigned long jiffies) {mod_delayed_work (system_power_efficient_wq, &phydev->state_queue, jiffies); } -EXPORT_SYMBOL (phy_queue_state_machine);/** * phy_trigger_machine - Trigger the state machine to run now include/linux/phy.h +0
-0
include/linux/phy.h int phy_drivers_register(struct phy_driver *new_driver, int n, · line 2066
Quoted 7 lines
include/linux/phy.h +0
-1@@ -2061,7 +2061,6 @@ int phy_drivers_register(struct phy_driver *new_driver, int n, struct module *owner);void phy_error (struct phy_device *phydev);void phy_state_machine (struct work_struct *work); -void phy_queue_state_machine (struct phy_device *phydev,unsigned long jiffies);void phy_trigger_machine (struct phy_device *phydev);void phy_mac_interrupt (struct phy_device *phydev);void phy_start_machine (struct phy_device *phydev);
Re: [PATCH net-next 4/4] net: phy: remove helper phy_is_internal
In reply to Heiner KallweitQuoted 46 lines · Heiner Kallweit
Helper
phy_is_internal()is just used in two places phylib-internally. So let's remove it from the API.Signed-off-by Heiner Kallweit <[email protected]>--- drivers/net/phy/phy.c | 2 +- drivers/net/phy/phy_device.c | 2 +- include/linux/phy.h | 9 --------- 3 files changed, 2 insertions(+), 11 deletions(-)drivers/net/phy/phy.c +1
-1@@ -302,7 +302,7 @@ void phy_ethtool_ksettings_get(struct phy_device *phydev, cmd->base.port =PORT_BNC ; else cmd->base.port = phydev->port; - cmd->base.transceiver =phy_is_internal (phydev) ? + cmd->base.transceiver = phydev->is_internal ?XCVR_INTERNAL :XCVR_EXTERNAL ; cmd->base.phy_address = phydev->mdio.addr; cmd->base.autoneg = phydev->autoneg;drivers/net/phy/phy_device.c +1
-1@@ -544,7 +544,7 @@ phy_interface_show(struct device *dev, struct device_attribute *attr, char *buf)struct phy_device *phydev =to_phy_device (dev);const char *mode =NULL ; -if (phy_is_internal (phydev)) +if (phydev->is_internal) mode ="internal" ;else mode =phy_modes (phydev->interface);include/linux/phy.h +0
-2@@ -1729,15 +1729,6 @@ static inline bool phy_is_default_hwtstamp(struct phy_device *phydev)return phy_has_hwtstamp (phydev) && phydev->default_timestamp; } -/** -* phy_is_internal - Convenience function for testing if a PHY is internal
include/linux/phy.h static inline bool phy_is_default_hwtstamp(struct phy_device *phydev) · line 1734
Quoted 10 lines
include/linux/phy.h +0
-7-* @phydev: the phy_device struct -*/ -static inline bool phy_is_internal (struct phy_device *phydev) -{ -return phydev->is_internal; -} -/** * phy_on_sfp - Convenience function for testing if a PHY is on an SFP module * @phydev: the phy_device struct
Thanks for that change.
Re: [PATCH net-next 2/4] net: phy: stop exporting feature arrays which aren't used outside phylib
In reply to Heiner KallweitQuoted 72 lines · Heiner Kallweit
Stop exporting feature arrays which aren't used outside phylib.
Signed-off-by Heiner Kallweit <[email protected]>--- drivers/net/phy/phy_device.c | 22 ++++++---------------- include/linux/phy.h | 5 ----- 2 files changed, 6 insertions(+), 21 deletions(-)drivers/net/phy/phy_device.c +6
-16@@ -91,37 +91,28 @@ static const int phy_all_ports_features_array[7] = { ETHTOOL_LINK_MODE_Backplane_BIT, }; -const int phy_10_100_features_array[4 ] = { +static const int phy_10_100_features_array[4 ] = { ETHTOOL_LINK_MODE_10baseT_Half_BIT, ETHTOOL_LINK_MODE_10baseT_Full_BIT, ETHTOOL_LINK_MODE_100baseT_Half_BIT, ETHTOOL_LINK_MODE_100baseT_Full_BIT, }; -EXPORT_SYMBOL_GPL (phy_10_100_features_array); -const int phy_basic_t1_features_array[3 ] = { +static const int phy_basic_t1_features_array[3 ] = {ETHTOOL_LINK_MODE_TP_BIT , ETHTOOL_LINK_MODE_10baseT1L_Full_BIT, ETHTOOL_LINK_MODE_100baseT1_Full_BIT, }; -EXPORT_SYMBOL_GPL (phy_basic_t1_features_array); -const int phy_basic_t1s_p2mp_features_array[2 ] = { +static const int phy_basic_t1s_p2mp_features_array[2 ] = {ETHTOOL_LINK_MODE_TP_BIT , ETHTOOL_LINK_MODE_10baseT1S_P2MP_Half_BIT, }; -EXPORT_SYMBOL_GPL (phy_basic_t1s_p2mp_features_array); -const int phy_gbit_features_array[2 ] = { +static const int phy_gbit_features_array[2 ] = { ETHTOOL_LINK_MODE_1000baseT_Half_BIT, ETHTOOL_LINK_MODE_1000baseT_Full_BIT, }; -EXPORT_SYMBOL_GPL (phy_gbit_features_array); - -const int phy_10gbit_features_array[1 ] = { - ETHTOOL_LINK_MODE_10000baseT_Full_BIT, -}; -EXPORT_SYMBOL_GPL (phy_10gbit_features_array);static const int phy_eee_cap1_features_array[] = { ETHTOOL_LINK_MODE_100baseT_Full_BIT,@@ -196,9 +187,8 @@ static void features_init(void)linkmode_set_bit_array (phy_gbit_features_array,ARRAY_SIZE (phy_gbit_features_array), phy_10gbit_features); -linkmode_set_bit_array (phy_10gbit_features_array, -ARRAY_SIZE (phy_10gbit_features_array), - phy_10gbit_features); +linkmode_set_bit (ETHTOOL_LINK_MODE_10000baseT_Full_BIT, + phy_10gbit_features); linkmode_set_bit_array(phy_eee_cap1_features_array, ARRAY_SIZE(phy_eee_cap1_features_array),include/linux/phy.h +0
-0@@ -54,11 +54,6 @@ extern __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_eee_cap2_features) __ro_after_init;#define PHY_EEE_CAP2_FEATURES ((unsigned long *)&phy_eee_cap2_features)
include/linux/phy.h extern __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_eee_cap2_features) __ro_after_init; · line 59
Quoted 10 lines
include/linux/phy.h +0
-5extern const int phy_basic_ports_array[3 ]; -extern const int phy_10_100_features_array[4 ]; -extern const int phy_basic_t1_features_array[3 ]; -extern const int phy_basic_t1s_p2mp_features_array[2 ]; -extern const int phy_gbit_features_array[2 ]; -extern const int phy_10gbit_features_array[1 ];/* * Set phydev->irq to PHY_POLL if interrupts are not supported,
Heiner Kallweit
maintainerRe: [PATCH net-next 1/4] net: phy: remove fixup-related definitions from phy.h which are not used outside phylib
In reply to Mateusz PolchlopekQuoted 12 lines · Mateusz Polchlopek
Quoted 9 lines · Heiner Kallweit
Certain fixup-related definitions aren't used outside
phy_device.c. So make them private and remove them fromphy.h.Signed-off-by Heiner Kallweit <[email protected]>---
drivers/net/phy/phy_device.c| 16 +++++++++++++--- include/linux/phy.h | 14 --------------2 files changed, 13 insertions(+), 17 deletions(-)
Quoted 14 lines
drivers/net/phy/phy_device.c
Quoted 10 lines
drivers/net/phy/phy_device.c +0
-0@@ -45,6 +45,17 @@ MODULE_DESCRIPTION("PHY library"); MODULE_AUTHOR("Andy Fleming"); MODULE_LICENSE("GPL");+#define PHY_ANY_ID "MATCH ANY PHY"
drivers/net/phy/phy_device.c +2
-0+#define PHY_ANY_UID 0xffffffff +Overall looks like a nice cleanup but I am not sure about this space between #define and
PHY_ANY_IDorPHY_ANY_UID...
There's a tab, which effectively equals a space. Maybe it's just the diff which is misleading. At least checkpatch didn't complain.
Quoted 63 lines
Quoted 62 lines
drivers/net/phy/phy_device.c +8
-0+struct phy_fixup { + struct list_head list; + char bus_id[MII_BUS_ID_SIZE + 3]; + u32 phy_uid; + u32 phy_uid_mask; + int (*run)(struct phy_device *phydev); +}; +
__ETHTOOL_DECLARE_LINK_MODE_MASK(phy_basic_features)__ro_after_init;EXPORT_SYMBOL_GPL(phy_basic_features);
@@ -378,8 +389,8 @@ static SIMPLE_DEV_PM_OPS(mdio_bus_phy_pm_ops,mdio_bus_phy_suspend, * comparison
* @run: The actual code to be run when a matching PHY is found
*/drivers/net/phy/phy_device.c +2
-2-int phy_register_fixup (const char *bus_id,u32 phy_uid,u32 phy_uid_mask, - int (*run)(struct phy_device *)) +static int phy_register_fixup (const char *bus_id,u32 phy_uid,u32 phy_uid_mask, + int (*run)(struct phy_device *)){
structphy_fixup*fixup =kzalloc(sizeof(*fixup), GFP_KERNEL);
@@ -397,7 +408,6 @@ int phy_register_fixup(const char*bus_id, u32phy_uid, u32phy_uid_mask, return 0;
}
-EXPORT_SYMBOL(phy_register_fixup);
/* Registers a fixup to be run on any PHY with the UID inphy_uid*/
int phy_register_fixup_for_uid(u32phy_uid, u32phy_uid_mask,include/linux/phy.h +0
-0@@ -1277,9 +1277,6 @@ struct phy_driver { #define to_phy_driver(d) container_of_const(to_mdio_common_driver(d), \ struct phy_driver, mdiodrv)-#define
PHY_ANY_ID"MATCH ANY PHY"include/linux/phy.h +0
-2-#define PHY_ANY_UID 0xffffffff -#define
PHY_ID_MATCH_EXACT(id).phy_id = (id), .phy_id_mask =GENMASK(31, 0)#definePHY_ID_MATCH_MODEL(id).phy_id = (id), .phy_id_mask =GENMASK(31, 4)#definePHY_ID_MATCH_VENDOR(id).phy_id = (id), .phy_id_mask =GENMASK(31, 10)include/linux/phy.h +0
-0@@ -1312,15 +1309,6 @@ static inline bool phydev_id_compare(struct phy_device *phydev, u32 id) return phy_id_compare(id, phydev->phy_id, phydev->drv->phy_id_mask); }-/* A Structure for boards to register fixups with the PHY Lib */
include/linux/phy.h +0
-8-struct phy_fixup { - struct list_head list; - char bus_id[MII_BUS_ID_SIZE + 3]; - u32 phy_uid; - u32 phy_uid_mask; - int (*run)(struct phy_device *phydev); -}; -const char *phy_speed_to_str(int speed);
const char *phy_duplex_to_str(unsigned int duplex); const char *phy_rate_matching_to_str(intrate_matching);include/linux/phy.h +0
-1@@ -2117,8 +2105,6 @@ s32 phy_get_internal_delay(struct phy_device *phydev, struct device *dev, void phy_resolve_pause(unsigned long *local_adv, unsigned long *partner_adv, bool *tx_pause, bool *rx_pause); -int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask, - int (*run)(struct phy_device *)); int phy_register_fixup_for_id(const char *bus_id, int (*run)(struct phy_device *)); int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask,
Re: [PATCH net-next 1/4] net: phy: remove fixup-related definitions from phy.h which are not used outside phylib
In reply to Heiner KallweitQuoted 4 lines · Heiner Kallweit
Certain fixup-related definitions aren't used outside
phy_device.c. So make them private and remove them fromphy.h.Signed-off-by Heiner Kallweit <[email protected]>
Thanks!
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Re: [PATCH net-next 2/4] net: phy: stop exporting feature arrays which aren't used outside phylib
In reply to Heiner KallweitQuoted 3 lines · Heiner Kallweit
Stop exporting feature arrays which aren't used outside phylib.
Signed-off-by Heiner Kallweit <[email protected]>
My grep confirms.
Thanks!
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Re: [PATCH net-next 3/4] net: phy: stop exporting phy_queue_state_machine
In reply to Heiner KallweitQuoted 4 lines · Heiner Kallweit
phy_queue_state_machine()isn't used outsidephy.c, so stop exporting it.Signed-off-by Heiner Kallweit <[email protected]>
My grep confirms.
Thanks!
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Re: [PATCH net-next 4/4] net: phy: remove helper phy_is_internal
In reply to Heiner KallweitQuoted 4 lines · Heiner Kallweit
Helper
phy_is_internal()is just used in two places phylib-internally. So let's remove it from the API.Signed-off-by Heiner Kallweit <[email protected]>
My grep confirms.
Thanks!
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Re: [PATCH net-next 1/4] net: phy: remove fixup-related definitions from phy.h which are not used outside phylib
In reply to Heiner KallweitQuoted 27 lines · Heiner Kallweit
Quoted 12 lines · Mateusz Polchlopek
Quoted 9 lines · Heiner Kallweit
Certain fixup-related definitions aren't used outside
phy_device.c. So make them private and remove them fromphy.h.Signed-off-by Heiner Kallweit <[email protected]>---
drivers/net/phy/phy_device.c| 16 +++++++++++++--- include/linux/phy.h | 14 --------------2 files changed, 13 insertions(+), 17 deletions(-)Quoted 14 lines
drivers/net/phy/phy_device.c
Quoted 10 lines
drivers/net/phy/phy_device.c +0
-0@@ -45,6 +45,17 @@ MODULE_DESCRIPTION("PHY library"); MODULE_AUTHOR("Andy Fleming"); MODULE_LICENSE("GPL");+#define PHY_ANY_ID "MATCH ANY PHY"
drivers/net/phy/phy_device.c +2
-0+#define PHY_ANY_UID 0xffffffff +Overall looks like a nice cleanup but I am not sure about this space between #define and
PHY_ANY_IDorPHY_ANY_UID...
Quoted 2 lines
There's a tab, which effectively equals a space. Maybe it's just the diff which is misleading. At least checkpatch didn't complain.
So long as it is a straight cut/paste from the old location, this is fine.
Andrew
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 11 lines · On Thu, 13 Feb 2025 22:47:04 +0100 you wrote:
This series is a starting point to clean up
phy.hand remove definitions which are phylib-internal.Heiner Kallweit (4):
net: phy: remove fixup-related definitions fromphy.hwhich are not
used outside phylib
net: phy: stop exporting feature arrays which aren't used outside
phylib
net: phy: stop exportingphy_queue_state_machine
net: phy: remove helperphy_is_internal
Quoted 1 line
[...]
Here is the summary with links:
- [net-next,1/4] net: phy: remove fixup-related definitions from phy.h which are not used outside phylib
https://git.kernel.org/netdev/net-next/c/ea47e70e476f - [net-next,2/4] net: phy: stop exporting feature arrays which aren't used outside phylib https://git.kernel.org/netdev/net-next/c/d3a0e217f850 - [net-next,3/4] net: phy: stop exporting phy_queue_state_machine https://git.kernel.org/netdev/net-next/c/ef6249e37df5 - [net-next,4/4] net: phy: remove helper phy_is_internal https://git.kernel.org/netdev/net-next/c/6b2edfba7469
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html