diff mbox series

[net-next,4/6] net: fman_memac: remove the now unnecessary checking for fixed-link

Message ID E1sCJN1-00Ecr7-02@rmk-PC.armlinux.org.uk (mailing list archive)
State Accepted
Commit 5e332954e7609acc9a265fcd9df53a3102206c8d
Delegated to: Netdev Maintainers
Headers show
Series net: phylink: rearrange ovr_an_inband support | 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: 902 this patch: 902
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 906 this patch: 906
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: 906 this patch: 906
netdev/checkpatch warning WARNING: 'overriden' may be misspelled - perhaps 'overridden'?
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-05-30--06-00 (tests: 1042)

Commit Message

Russell King (Oracle) May 29, 2024, 1:29 p.m. UTC
Since default_an_inband can be overriden by a fixed-link specification,
there is no need for memac to be checking for this before setting
default_an_inband. Remove this code and update the comment.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/ethernet/freescale/fman/fman_memac.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

Comments

Sean Anderson May 30, 2024, 2:57 p.m. UTC | #1
On 5/29/24 09:29, Russell King (Oracle) wrote:
> Since default_an_inband can be overriden by a fixed-link specification,
> there is no need for memac to be checking for this before setting
> default_an_inband. Remove this code and update the comment.
>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
>  drivers/net/ethernet/freescale/fman/fman_memac.c | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c
> index 9c44a3581950..796e6f4e583d 100644
> --- a/drivers/net/ethernet/freescale/fman/fman_memac.c
> +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c
> @@ -1066,7 +1066,6 @@ int memac_initialization(struct mac_device *mac_dev,
>                        struct fman_mac_params *params)
>  {
>       int                      err;
> -     struct device_node      *fixed;
>       struct phylink_pcs      *pcs;
>       struct fman_mac         *memac;
>       unsigned long            capabilities;
> @@ -1222,18 +1221,15 @@ int memac_initialization(struct mac_device *mac_dev,
>               memac->rgmii_no_half_duplex = true;
>
>       /* Most boards should use MLO_AN_INBAND, but existing boards don't have
> -      * a managed property. Default to MLO_AN_INBAND if nothing else is
> -      * specified. We need to be careful and not enable this if we have a
> -      * fixed link or if we are using MII or RGMII, since those
> -      * configurations modes don't use in-band autonegotiation.
> +      * a managed property. Default to MLO_AN_INBAND rather than MLO_AN_PHY.
> +      * Phylink will allow this to be overriden by a fixed link. We need to
> +      * be careful and not enable this if we are using MII or RGMII, since
> +      * those configurations modes don't use in-band autonegotiation.
>        */
> -     fixed = of_get_child_by_name(mac_node, "fixed-link");
> -     if (!fixed && !of_property_read_bool(mac_node, "fixed-link") &&
> -         !of_property_read_bool(mac_node, "managed") &&
> +     if (!of_property_read_bool(mac_node, "managed") &&
>           mac_dev->phy_if != PHY_INTERFACE_MODE_MII &&
>           !phy_interface_mode_is_rgmii(mac_dev->phy_if))
>               mac_dev->phylink_config.default_an_inband = true;
> -     of_node_put(fixed);
>
>       err = memac_init(mac_dev->fman_mac);
>       if (err < 0)

Reviewed-by: Sean Anderson <sean.anderson@seco.com>

[Clea Astarte Google Cloud, SECO SpA]<https://clea.ai/astarte-on-google-cloud>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c
index 9c44a3581950..796e6f4e583d 100644
--- a/drivers/net/ethernet/freescale/fman/fman_memac.c
+++ b/drivers/net/ethernet/freescale/fman/fman_memac.c
@@ -1066,7 +1066,6 @@  int memac_initialization(struct mac_device *mac_dev,
 			 struct fman_mac_params *params)
 {
 	int			 err;
-	struct device_node      *fixed;
 	struct phylink_pcs	*pcs;
 	struct fman_mac		*memac;
 	unsigned long		 capabilities;
@@ -1222,18 +1221,15 @@  int memac_initialization(struct mac_device *mac_dev,
 		memac->rgmii_no_half_duplex = true;
 
 	/* Most boards should use MLO_AN_INBAND, but existing boards don't have
-	 * a managed property. Default to MLO_AN_INBAND if nothing else is
-	 * specified. We need to be careful and not enable this if we have a
-	 * fixed link or if we are using MII or RGMII, since those
-	 * configurations modes don't use in-band autonegotiation.
+	 * a managed property. Default to MLO_AN_INBAND rather than MLO_AN_PHY.
+	 * Phylink will allow this to be overriden by a fixed link. We need to
+	 * be careful and not enable this if we are using MII or RGMII, since
+	 * those configurations modes don't use in-band autonegotiation.
 	 */
-	fixed = of_get_child_by_name(mac_node, "fixed-link");
-	if (!fixed && !of_property_read_bool(mac_node, "fixed-link") &&
-	    !of_property_read_bool(mac_node, "managed") &&
+	if (!of_property_read_bool(mac_node, "managed") &&
 	    mac_dev->phy_if != PHY_INTERFACE_MODE_MII &&
 	    !phy_interface_mode_is_rgmii(mac_dev->phy_if))
 		mac_dev->phylink_config.default_an_inband = true;
-	of_node_put(fixed);
 
 	err = memac_init(mac_dev->fman_mac);
 	if (err < 0)