From: Marek Vasut Date: Fri, 20 Dec 2024 00:48:40 +0000 (+0100) Subject: net: rswitch: Fold MPSM C45 setting into rswitch_mii_access_c45() X-Git-Tag: v2025.04-rc1~17^2~25^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3f0977ee6803a9e50803a081848b1f8066d6ded;p=pandora-u-boot.git net: rswitch: Fold MPSM C45 setting into rswitch_mii_access_c45() The Set Station Management Mode : Clause 45 setting of MFF bit in MPSM register can be done in rswitch_mii_access_c45() once, instead of this being done before each rswitch_mii_access_c45() call. Deduplicate the bit setting into rswitch_mii_access_c45(). No functional change. Signed-off-by: Marek Vasut --- diff --git a/drivers/net/rswitch.c b/drivers/net/rswitch.c index 58fd55c996f..f53c504367a 100644 --- a/drivers/net/rswitch.c +++ b/drivers/net/rswitch.c @@ -365,6 +365,9 @@ static int rswitch_mii_access_c45(struct rswitch_etha *etha, bool read, if (devad == 0xffffffff) return 0; + /* Set Station Management Mode : Clause 45 */ + setbits_le32(etha->addr + MPSM, MPSM_MFF_C45); + /* Clear completion flags */ writel(MMIS1_CLEAR_FLAGS, etha->addr + MMIS1); @@ -429,9 +432,6 @@ static int rswitch_mii_read_c45(struct mii_dev *miidev, int phyad, int devad, in MPIC_PSMCS_MASK | MPIC_PSMHT_MASK, MPIC_MDC_CLK_SET); - /* Set Station Management Mode : Clause 45 */ - setbits_le32(etha->addr + MPSM, MPSM_MFF_C45); - /* Access PHY register */ val = rswitch_mii_access_c45(etha, true, phyad, devad, regad, 0); @@ -460,9 +460,6 @@ int rswitch_mii_write_c45(struct mii_dev *miidev, int phyad, int devad, int rega MPIC_PSMCS_MASK | MPIC_PSMHT_MASK, MPIC_MDC_CLK_SET); - /* Set Station Management Mode : Clause 45 */ - setbits_le32(etha->addr + MPSM, MPSM_MFF_C45); - /* Access PHY register */ rswitch_mii_access_c45(etha, false, phyad, devad, regad, data);