Skip to content

Commit da75ba9

Browse files
nikita-youshkuba-moo
authored andcommitted
net: renesas: rswitch: use FIELD_PREP for remaining MPIC register fields
Commit fb9e603 ("net: renesas: rswitch: fix initial MPIC register setting") converted setting some MPIC fields to FIELD_PREP. To keep common style, do the same with mii bus related fields of the same register. Signed-off-by: Nikita Yushchenko <[email protected]> Reviewed-by: Yoshihiro Shimoda <[email protected]> Tested-by: Yoshihiro Shimoda <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 206112f commit da75ba9

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

drivers/net/ethernet/renesas/rswitch.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,8 +1164,9 @@ static void rswitch_rmac_setting(struct rswitch_etha *etha, const u8 *mac)
11641164

11651165
static void rswitch_etha_enable_mii(struct rswitch_etha *etha)
11661166
{
1167-
rswitch_modify(etha->addr, MPIC, MPIC_PSMCS_MASK | MPIC_PSMHT_MASK,
1168-
MPIC_PSMCS(etha->psmcs) | MPIC_PSMHT(0x06));
1167+
rswitch_modify(etha->addr, MPIC, MPIC_PSMCS | MPIC_PSMHT,
1168+
FIELD_PREP(MPIC_PSMCS, etha->psmcs) |
1169+
FIELD_PREP(MPIC_PSMHT, 0x06));
11691170
}
11701171

11711172
static int rswitch_etha_hw_init(struct rswitch_etha *etha, const u8 *mac)

drivers/net/ethernet/renesas/rswitch.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,8 @@ enum rswitch_etha_mode {
732732
#define MPIC_LSC_100M 1
733733
#define MPIC_LSC_1G 2
734734
#define MPIC_LSC_2_5G 3
735+
#define MPIC_PSMCS GENMASK(22, 16)
736+
#define MPIC_PSMHT GENMASK(26, 24)
735737

736738
#define MDIO_READ_C45 0x03
737739
#define MDIO_WRITE_C45 0x01
@@ -747,14 +749,6 @@ enum rswitch_etha_mode {
747749
#define MMIS1_PRACS BIT(0) /* Read */
748750
#define MMIS1_CLEAR_FLAGS 0xf
749751

750-
#define MPIC_PSMCS_SHIFT 16
751-
#define MPIC_PSMCS_MASK GENMASK(22, MPIC_PSMCS_SHIFT)
752-
#define MPIC_PSMCS(val) ((val) << MPIC_PSMCS_SHIFT)
753-
754-
#define MPIC_PSMHT_SHIFT 24
755-
#define MPIC_PSMHT_MASK GENMASK(26, MPIC_PSMHT_SHIFT)
756-
#define MPIC_PSMHT(val) ((val) << MPIC_PSMHT_SHIFT)
757-
758752
#define MLVC_PLV BIT(16)
759753

760754
/* GWCA */

0 commit comments

Comments
 (0)