1 /// Use mdio_alloc and mdio_register instead of miiphy_register
3 //# Stop using the oldest mii interface in drivers
6 // Copyright: (C) 2016 Joe Hershberger. GPLv2.
8 // Options: --include-headers --recursive-includes --local-includes -I include
12 identifier readfunc, writefunc;
16 - miiphy_register(devname, readfunc, writefunc);
17 + struct mii_dev *mdiodev = mdio_alloc();
18 + if (!mdiodev) return -ENOMEM;
19 + strncpy(mdiodev->name, devname, MDIO_NAME_LEN);
20 + mdiodev->read = readfunc;
21 + mdiodev->write = writefunc;
23 + retval = mdio_register(mdiodev);
24 + if (retval < 0) return retval;
27 identifier mii_reg.readfunc;
28 identifier name0, addr0, reg0, output;
39 + struct mii_dev *bus,
49 identifier mii_reg.readfunc;
50 identifier update_read_sig.output;
51 type update_read_sig.outputT;
81 identifier mii_reg.readfunc;
82 identifier update_read_sig.output;
99 identifier mii_reg.readfunc;
100 identifier update_read_sig.name0;
110 identifier mii_reg.writefunc;
111 identifier name0, addr0, reg0, value0;
123 + struct mii_dev *bus,
133 @ update_write_name @
134 identifier mii_reg.writefunc;
135 identifier update_write_sig.name0;