diff options
author | Joe Hershberger <joe.hershberger@ni.com> | 2016-08-08 11:28:38 -0500 |
---|---|---|
committer | Joe Hershberger <joe.hershberger@ni.com> | 2016-08-15 15:26:33 -0500 |
commit | 5a49f17481bb9dcab1431c663d35cc1cace16825 (patch) | |
tree | 239447b5c4c6da4f9ca2c298f33ed73c39a9020d /board | |
parent | 63d985985e383111e082c78398444941a0b9fadf (diff) |
net: mii: Use spatch to update miiphy_register
Run scripts/coccinelle/net/mdio_register.cocci on the U-Boot code base.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/gdsys/405ep/io.c | 13 | ||||
-rw-r--r-- | board/gdsys/405ep/iocon.c | 27 | ||||
-rw-r--r-- | board/gdsys/405ex/io64.c | 26 | ||||
-rw-r--r-- | board/gdsys/mpc8308/hrcon.c | 27 | ||||
-rw-r--r-- | board/gdsys/mpc8308/strider.c | 27 |
5 files changed, 102 insertions, 18 deletions
diff --git a/board/gdsys/405ep/io.c b/board/gdsys/405ep/io.c index 03d796cdb89..81b49659ff8 100644 --- a/board/gdsys/405ep/io.c +++ b/board/gdsys/405ep/io.c @@ -172,8 +172,17 @@ int last_stage_init(void) print_fpga_info(); - miiphy_register(CONFIG_SYS_GBIT_MII_BUSNAME, - bb_miiphy_read, bb_miiphy_write); + int retval; + struct mii_dev *mdiodev = mdio_alloc(); + if (!mdiodev) + return -ENOMEM; + strncpy(mdiodev->name, CONFIG_SYS_GBIT_MII_BUSNAME, MDIO_NAME_LEN); + mdiodev->read = bb_miiphy_read; + mdiodev->write = bb_miiphy_write; + + retval = mdio_register(mdiodev); + if (retval < 0) + return retval; for (k = 0; k < 32; ++k) configure_gbit_phy(k); diff --git a/board/gdsys/405ep/iocon.c b/board/gdsys/405ep/iocon.c index 7484624d13e..7db0e29ea6c 100644 --- a/board/gdsys/405ep/iocon.c +++ b/board/gdsys/405ep/iocon.c @@ -405,8 +405,17 @@ int last_stage_init(void) } if (!legacy && (feature_carrier_speed == CARRIER_SPEED_1G)) { - miiphy_register(bb_miiphy_buses[0].name, bb_miiphy_read, - bb_miiphy_write); + int retval; + struct mii_dev *mdiodev = mdio_alloc(); + if (!mdiodev) + return -ENOMEM; + strncpy(mdiodev->name, bb_miiphy_buses[0].name, MDIO_NAME_LEN); + mdiodev->read = bb_miiphy_read; + mdiodev->write = bb_miiphy_write; + + retval = mdio_register(mdiodev); + if (retval < 0) + return retval; for (mux_ch = 0; mux_ch < MAX_MUX_CHANNELS; ++mux_ch) { if ((mux_ch == 1) && !ch0_rgmii2_present) continue; @@ -437,8 +446,18 @@ int last_stage_init(void) print_fpga_info(k, false); osd_probe(k); if (feature_carrier_speed == CARRIER_SPEED_1G) { - miiphy_register(bb_miiphy_buses[k].name, - bb_miiphy_read, bb_miiphy_write); + int retval; + struct mii_dev *mdiodev = mdio_alloc(); + if (!mdiodev) + return -ENOMEM; + strncpy(mdiodev->name, bb_miiphy_buses[k].name, + MDIO_NAME_LEN); + mdiodev->read = bb_miiphy_read; + mdiodev->write = bb_miiphy_write; + + retval = mdio_register(mdiodev); + if (retval < 0) + return retval; setup_88e1518(bb_miiphy_buses[k].name, 0); } } diff --git a/board/gdsys/405ex/io64.c b/board/gdsys/405ex/io64.c index 3a075c471f8..6a837883a7b 100644 --- a/board/gdsys/405ex/io64.c +++ b/board/gdsys/405ex/io64.c @@ -246,8 +246,17 @@ int last_stage_init(void) /* setup Gbit PHYs */ puts("TRANS: "); puts(str_phys); - miiphy_register(CONFIG_SYS_GBIT_MII_BUSNAME, - bb_miiphy_read, bb_miiphy_write); + int retval; + struct mii_dev *mdiodev = mdio_alloc(); + if (!mdiodev) + return -ENOMEM; + strncpy(mdiodev->name, CONFIG_SYS_GBIT_MII_BUSNAME, MDIO_NAME_LEN); + mdiodev->read = bb_miiphy_read; + mdiodev->write = bb_miiphy_write; + + retval = mdio_register(mdiodev); + if (retval < 0) + return retval; for (k = 0; k < 32; ++k) { configure_gbit_phy(CONFIG_SYS_GBIT_MII_BUSNAME, k); @@ -255,8 +264,17 @@ int last_stage_init(void) putc(slash[k % 8]); } - miiphy_register(CONFIG_SYS_GBIT_MII1_BUSNAME, - bb_miiphy_read, bb_miiphy_write); + int retval; + struct mii_dev *mdiodev = mdio_alloc(); + if (!mdiodev) + return -ENOMEM; + strncpy(mdiodev->name, CONFIG_SYS_GBIT_MII1_BUSNAME, MDIO_NAME_LEN); + mdiodev->read = bb_miiphy_read; + mdiodev->write = bb_miiphy_write; + + retval = mdio_register(mdiodev); + if (retval < 0) + return retval; for (k = 0; k < 32; ++k) { configure_gbit_phy(CONFIG_SYS_GBIT_MII1_BUSNAME, k); diff --git a/board/gdsys/mpc8308/hrcon.c b/board/gdsys/mpc8308/hrcon.c index 880b6387de2..f55893f79c9 100644 --- a/board/gdsys/mpc8308/hrcon.c +++ b/board/gdsys/mpc8308/hrcon.c @@ -162,8 +162,17 @@ int last_stage_init(void) } if (hw_type_cat) { - miiphy_register(bb_miiphy_buses[0].name, bb_miiphy_read, - bb_miiphy_write); + int retval; + struct mii_dev *mdiodev = mdio_alloc(); + if (!mdiodev) + return -ENOMEM; + strncpy(mdiodev->name, bb_miiphy_buses[0].name, MDIO_NAME_LEN); + mdiodev->read = bb_miiphy_read; + mdiodev->write = bb_miiphy_write; + + retval = mdio_register(mdiodev); + if (retval < 0) + return retval; for (mux_ch = 0; mux_ch < MAX_MUX_CHANNELS; ++mux_ch) { if ((mux_ch == 1) && !ch0_rgmii2_present) continue; @@ -199,8 +208,18 @@ int last_stage_init(void) osd_probe(k + 4); #endif if (hw_type_cat) { - miiphy_register(bb_miiphy_buses[k].name, - bb_miiphy_read, bb_miiphy_write); + int retval; + struct mii_dev *mdiodev = mdio_alloc(); + if (!mdiodev) + return -ENOMEM; + strncpy(mdiodev->name, bb_miiphy_buses[k].name, + MDIO_NAME_LEN); + mdiodev->read = bb_miiphy_read; + mdiodev->write = bb_miiphy_write; + + retval = mdio_register(mdiodev); + if (retval < 0) + return retval; setup_88e1514(bb_miiphy_buses[k].name, 0); } } diff --git a/board/gdsys/mpc8308/strider.c b/board/gdsys/mpc8308/strider.c index 121977d315f..b8dde5f1bad 100644 --- a/board/gdsys/mpc8308/strider.c +++ b/board/gdsys/mpc8308/strider.c @@ -179,8 +179,17 @@ int last_stage_init(void) } if (hw_type_cat) { - miiphy_register(bb_miiphy_buses[0].name, bb_miiphy_read, - bb_miiphy_write); + int retval; + struct mii_dev *mdiodev = mdio_alloc(); + if (!mdiodev) + return -ENOMEM; + strncpy(mdiodev->name, bb_miiphy_buses[0].name, MDIO_NAME_LEN); + mdiodev->read = bb_miiphy_read; + mdiodev->write = bb_miiphy_write; + + retval = mdio_register(mdiodev); + if (retval < 0) + return retval; for (mux_ch = 0; mux_ch < MAX_MUX_CHANNELS; ++mux_ch) { if ((mux_ch == 1) && !ch0_sgmii2_present) continue; @@ -252,8 +261,18 @@ int last_stage_init(void) dp501_probe(k, false); #endif if (hw_type_cat) { - miiphy_register(bb_miiphy_buses[k].name, - bb_miiphy_read, bb_miiphy_write); + int retval; + struct mii_dev *mdiodev = mdio_alloc(); + if (!mdiodev) + return -ENOMEM; + strncpy(mdiodev->name, bb_miiphy_buses[k].name, + MDIO_NAME_LEN); + mdiodev->read = bb_miiphy_read; + mdiodev->write = bb_miiphy_write; + + retval = mdio_register(mdiodev); + if (retval < 0) + return retval; setup_88e1514(bb_miiphy_buses[k].name, 0); } } |