X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fnet%2Fphy%2Fmiiphybb.c;h=af676b9baeec956f3c85d61bf1141a860cc7c274;hb=623f60198b38c4fdae596038cd5956e44b6224a4;hp=49a1f5fb49fd8269852ad8a6c138652b4549bc75;hpb=17dd883c5b76bdade0f7a48f2eb02d918a5ebef9;p=u-boot diff --git a/drivers/net/phy/miiphybb.c b/drivers/net/phy/miiphybb.c index 49a1f5fb49..af676b9bae 100644 --- a/drivers/net/phy/miiphybb.c +++ b/drivers/net/phy/miiphybb.c @@ -5,23 +5,7 @@ * (C) Copyright 2001 * Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com. * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * SPDX-License-Identifier: GPL-2.0+ */ /* @@ -246,24 +230,18 @@ static void miiphy_pre(struct bb_miiphy_bus *bus, char read, * Returns: * 0 on success */ -int bb_miiphy_read(const char *devname, unsigned char addr, - unsigned char reg, unsigned short *value) +int bb_miiphy_read(struct mii_dev *miidev, int addr, int devad, int reg) { short rdreg; /* register working value */ int v; int j; /* counter */ struct bb_miiphy_bus *bus; - bus = bb_miiphy_getbus(devname); + bus = bb_miiphy_getbus(miidev->name); if (bus == NULL) { return -1; } - if (value == NULL) { - puts("NULL value pointer\n"); - return -1; - } - miiphy_pre (bus, 1, addr, reg); /* tri-state our MDIO I/O pin so we can read */ @@ -283,8 +261,7 @@ int bb_miiphy_read(const char *devname, unsigned char addr, bus->set_mdc(bus, 1); bus->delay(bus); } - /* There is no PHY, set value to 0xFFFF and return */ - *value = 0xFFFF; + /* There is no PHY, return */ return -1; } @@ -310,13 +287,11 @@ int bb_miiphy_read(const char *devname, unsigned char addr, bus->set_mdc(bus, 1); bus->delay(bus); - *value = rdreg; - #ifdef DEBUG - printf ("miiphy_read(0x%x) @ 0x%x = 0x%04x\n", reg, addr, *value); + printf("miiphy_read(0x%x) @ 0x%x = 0x%04x\n", reg, addr, rdreg); #endif - return 0; + return rdreg; } @@ -327,13 +302,13 @@ int bb_miiphy_read(const char *devname, unsigned char addr, * Returns: * 0 on success */ -int bb_miiphy_write (const char *devname, unsigned char addr, - unsigned char reg, unsigned short value) +int bb_miiphy_write(struct mii_dev *miidev, int addr, int devad, int reg, + u16 value) { struct bb_miiphy_bus *bus; int j; /* counter */ - bus = bb_miiphy_getbus(devname); + bus = bb_miiphy_getbus(miidev->name); if (bus == NULL) { /* Bus not found! */ return -1;