Skip to content

Commit d169d47

Browse files
marckleinebuddeNipaLocal
authored andcommitted
net: fec: fec_restart(): introduce a define for FEC_ECR_SPEED
Replace "1 << 5" for configuring 1000 MBit/s with a defined constant to improve code readability and maintainability. Reviewed-by: Wei Fang <[email protected]> Reviewed-by: Frank Li <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent 90055ef commit d169d47

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ MODULE_PARM_DESC(macaddr, "FEC Ethernet MAC address");
275275
#define FEC_ECR_MAGICEN BIT(2)
276276
#define FEC_ECR_SLEEP BIT(3)
277277
#define FEC_ECR_EN1588 BIT(4)
278+
#define FEC_ECR_SPEED BIT(5)
278279
#define FEC_ECR_BYTESWP BIT(8)
279280
/* FEC RCR bits definition */
280281
#define FEC_RCR_LOOP BIT(0)
@@ -1206,7 +1207,7 @@ fec_restart(struct net_device *ndev)
12061207
/* 1G, 100M or 10M */
12071208
if (ndev->phydev) {
12081209
if (ndev->phydev->speed == SPEED_1000)
1209-
ecntl |= (1 << 5);
1210+
ecntl |= FEC_ECR_SPEED;
12101211
else if (ndev->phydev->speed == SPEED_100)
12111212
rcntl &= ~FEC_RCR_10BASET;
12121213
else

0 commit comments

Comments
 (0)