Skip to content

Commit 50430d1

Browse files
committed
Merge branch 'net-add-const-to-mii_phy_ops-structures'
Bhumika Goyal says: ==================== drivers: net: add const to mii_phy_ops structures The object references of mii_phy_ops structures are only stored in the ops field of a mii_phy_def structure. This ops field is of type const. So, mii_phy_ops structures having similar properties can be declared as const. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 3948b57 + d193d53 commit 50430d1

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

drivers/net/ethernet/ibm/emac/phy.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ static int genmii_read_link(struct mii_phy *phy)
276276
}
277277

278278
/* Generic implementation for most 10/100/1000 PHYs */
279-
static struct mii_phy_ops generic_phy_ops = {
279+
static const struct mii_phy_ops generic_phy_ops = {
280280
.setup_aneg = genmii_setup_aneg,
281281
.setup_forced = genmii_setup_forced,
282282
.poll_link = genmii_poll_link,
@@ -340,7 +340,7 @@ static int cis8201_init(struct mii_phy *phy)
340340
return 0;
341341
}
342342

343-
static struct mii_phy_ops cis8201_phy_ops = {
343+
static const struct mii_phy_ops cis8201_phy_ops = {
344344
.init = cis8201_init,
345345
.setup_aneg = genmii_setup_aneg,
346346
.setup_forced = genmii_setup_forced,
@@ -420,7 +420,7 @@ static int et1011c_init(struct mii_phy *phy)
420420
return 0;
421421
}
422422

423-
static struct mii_phy_ops et1011c_phy_ops = {
423+
static const struct mii_phy_ops et1011c_phy_ops = {
424424
.init = et1011c_init,
425425
.setup_aneg = genmii_setup_aneg,
426426
.setup_forced = genmii_setup_forced,
@@ -439,7 +439,7 @@ static struct mii_phy_def et1011c_phy_def = {
439439

440440

441441

442-
static struct mii_phy_ops m88e1111_phy_ops = {
442+
static const struct mii_phy_ops m88e1111_phy_ops = {
443443
.init = m88e1111_init,
444444
.setup_aneg = genmii_setup_aneg,
445445
.setup_forced = genmii_setup_forced,
@@ -455,7 +455,7 @@ static struct mii_phy_def m88e1111_phy_def = {
455455
.ops = &m88e1111_phy_ops,
456456
};
457457

458-
static struct mii_phy_ops m88e1112_phy_ops = {
458+
static const struct mii_phy_ops m88e1112_phy_ops = {
459459
.init = m88e1112_init,
460460
.setup_aneg = genmii_setup_aneg,
461461
.setup_forced = genmii_setup_forced,
@@ -480,7 +480,7 @@ static int ar8035_init(struct mii_phy *phy)
480480
return 0;
481481
}
482482

483-
static struct mii_phy_ops ar8035_phy_ops = {
483+
static const struct mii_phy_ops ar8035_phy_ops = {
484484
.init = ar8035_init,
485485
.setup_aneg = genmii_setup_aneg,
486486
.setup_forced = genmii_setup_forced,

drivers/net/sungem_phy.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ static int marvell_read_link(struct mii_phy *phy)
886886
SUPPORTED_1000baseT_Half | SUPPORTED_1000baseT_Full)
887887

888888
/* Broadcom BCM 5201 */
889-
static struct mii_phy_ops bcm5201_phy_ops = {
889+
static const struct mii_phy_ops bcm5201_phy_ops = {
890890
.init = bcm5201_init,
891891
.suspend = bcm5201_suspend,
892892
.setup_aneg = genmii_setup_aneg,
@@ -905,7 +905,7 @@ static struct mii_phy_def bcm5201_phy_def = {
905905
};
906906

907907
/* Broadcom BCM 5221 */
908-
static struct mii_phy_ops bcm5221_phy_ops = {
908+
static const struct mii_phy_ops bcm5221_phy_ops = {
909909
.suspend = bcm5221_suspend,
910910
.init = bcm5221_init,
911911
.setup_aneg = genmii_setup_aneg,
@@ -924,7 +924,7 @@ static struct mii_phy_def bcm5221_phy_def = {
924924
};
925925

926926
/* Broadcom BCM 5241 */
927-
static struct mii_phy_ops bcm5241_phy_ops = {
927+
static const struct mii_phy_ops bcm5241_phy_ops = {
928928
.suspend = bcm5241_suspend,
929929
.init = bcm5241_init,
930930
.setup_aneg = genmii_setup_aneg,
@@ -942,7 +942,7 @@ static struct mii_phy_def bcm5241_phy_def = {
942942
};
943943

944944
/* Broadcom BCM 5400 */
945-
static struct mii_phy_ops bcm5400_phy_ops = {
945+
static const struct mii_phy_ops bcm5400_phy_ops = {
946946
.init = bcm5400_init,
947947
.suspend = bcm5400_suspend,
948948
.setup_aneg = bcm54xx_setup_aneg,
@@ -961,7 +961,7 @@ static struct mii_phy_def bcm5400_phy_def = {
961961
};
962962

963963
/* Broadcom BCM 5401 */
964-
static struct mii_phy_ops bcm5401_phy_ops = {
964+
static const struct mii_phy_ops bcm5401_phy_ops = {
965965
.init = bcm5401_init,
966966
.suspend = bcm5401_suspend,
967967
.setup_aneg = bcm54xx_setup_aneg,
@@ -980,7 +980,7 @@ static struct mii_phy_def bcm5401_phy_def = {
980980
};
981981

982982
/* Broadcom BCM 5411 */
983-
static struct mii_phy_ops bcm5411_phy_ops = {
983+
static const struct mii_phy_ops bcm5411_phy_ops = {
984984
.init = bcm5411_init,
985985
.suspend = generic_suspend,
986986
.setup_aneg = bcm54xx_setup_aneg,
@@ -999,7 +999,7 @@ static struct mii_phy_def bcm5411_phy_def = {
999999
};
10001000

10011001
/* Broadcom BCM 5421 */
1002-
static struct mii_phy_ops bcm5421_phy_ops = {
1002+
static const struct mii_phy_ops bcm5421_phy_ops = {
10031003
.init = bcm5421_init,
10041004
.suspend = generic_suspend,
10051005
.setup_aneg = bcm54xx_setup_aneg,
@@ -1019,7 +1019,7 @@ static struct mii_phy_def bcm5421_phy_def = {
10191019
};
10201020

10211021
/* Broadcom BCM 5421 built-in K2 */
1022-
static struct mii_phy_ops bcm5421k2_phy_ops = {
1022+
static const struct mii_phy_ops bcm5421k2_phy_ops = {
10231023
.init = bcm5421_init,
10241024
.suspend = generic_suspend,
10251025
.setup_aneg = bcm54xx_setup_aneg,
@@ -1037,7 +1037,7 @@ static struct mii_phy_def bcm5421k2_phy_def = {
10371037
.ops = &bcm5421k2_phy_ops
10381038
};
10391039

1040-
static struct mii_phy_ops bcm5461_phy_ops = {
1040+
static const struct mii_phy_ops bcm5461_phy_ops = {
10411041
.init = bcm5421_init,
10421042
.suspend = generic_suspend,
10431043
.setup_aneg = bcm54xx_setup_aneg,
@@ -1057,7 +1057,7 @@ static struct mii_phy_def bcm5461_phy_def = {
10571057
};
10581058

10591059
/* Broadcom BCM 5462 built-in Vesta */
1060-
static struct mii_phy_ops bcm5462V_phy_ops = {
1060+
static const struct mii_phy_ops bcm5462V_phy_ops = {
10611061
.init = bcm5421_init,
10621062
.suspend = generic_suspend,
10631063
.setup_aneg = bcm54xx_setup_aneg,
@@ -1076,15 +1076,15 @@ static struct mii_phy_def bcm5462V_phy_def = {
10761076
};
10771077

10781078
/* Marvell 88E1101 amd 88E1111 */
1079-
static struct mii_phy_ops marvell88e1101_phy_ops = {
1079+
static const struct mii_phy_ops marvell88e1101_phy_ops = {
10801080
.suspend = generic_suspend,
10811081
.setup_aneg = marvell_setup_aneg,
10821082
.setup_forced = marvell_setup_forced,
10831083
.poll_link = genmii_poll_link,
10841084
.read_link = marvell_read_link
10851085
};
10861086

1087-
static struct mii_phy_ops marvell88e1111_phy_ops = {
1087+
static const struct mii_phy_ops marvell88e1111_phy_ops = {
10881088
.init = marvell88e1111_init,
10891089
.suspend = generic_suspend,
10901090
.setup_aneg = marvell_setup_aneg,
@@ -1122,7 +1122,7 @@ static struct mii_phy_def marvell88e1111_phy_def = {
11221122
};
11231123

11241124
/* Generic implementation for most 10/100 PHYs */
1125-
static struct mii_phy_ops generic_phy_ops = {
1125+
static const struct mii_phy_ops generic_phy_ops = {
11261126
.setup_aneg = genmii_setup_aneg,
11271127
.setup_forced = genmii_setup_forced,
11281128
.poll_link = genmii_poll_link,

0 commit comments

Comments
 (0)