diff mbox series

[net-next,4/4] net: phy: remove helper phy_is_internal

Message ID f3f35265-80a9-4ed7-ad78-ae22c21e288b@gmail.com (mailing list archive)
State Accepted
Commit 6b2edfba74696e0defd181989c9effe911e6f54f
Delegated to: Netdev Maintainers
Headers show
Series net: phy: clean up phy.h | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1 this patch: 1
netdev/build_tools success Errors and warnings before: 26 (+1) this patch: 26 (+1)
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 94 this patch: 94
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 362 this patch: 362
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 31 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 105 this patch: 104
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2025-02-14--18-00 (tests: 889)

Commit Message

Heiner Kallweit Feb. 13, 2025, 9:51 p.m. UTC
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 <hkallweit1@gmail.com>
---
 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(-)

Comments

Mateusz Polchlopek Feb. 14, 2025, 11:01 a.m. UTC | #1
On 2/13/2025 10:51 PM, Heiner Kallweit wrote:
> 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 <hkallweit1@gmail.com>
> ---
>   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(-)
> 
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index 8738ffb4c..77b3fb843 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -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;
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index 1c10c774b..35ec99b4d 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -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);
> diff --git a/include/linux/phy.h b/include/linux/phy.h
> index bb7454364..8efbf62d8 100644
> --- a/include/linux/phy.h
> +++ b/include/linux/phy.h
> @@ -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

Thanks for that change.

Reviewed-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
Russell King (Oracle) Feb. 14, 2025, 2:54 p.m. UTC | #2
On Thu, Feb 13, 2025 at 10:51:53PM +0100, Heiner Kallweit wrote:
> 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 <hkallweit1@gmail.com>

My grep confirms.

Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Thanks!
diff mbox series

Patch

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 8738ffb4c..77b3fb843 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -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;
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 1c10c774b..35ec99b4d 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -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);
diff --git a/include/linux/phy.h b/include/linux/phy.h
index bb7454364..8efbf62d8 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -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