X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fmcfmii.c;h=961618b4109c62f26a116b21302832b30f03b25f;hb=ceb6ddbc73607e9395bb5f0ad94159755f049e77;hp=5e64dbdd177548c40a8913ffdc481b02120ee4a1;hpb=c68436fa427a69ea308d74c410067507d6c7103b;p=oweals%2Fu-boot.git diff --git a/drivers/net/mcfmii.c b/drivers/net/mcfmii.c index 5e64dbdd17..961618b410 100644 --- a/drivers/net/mcfmii.c +++ b/drivers/net/mcfmii.c @@ -1,24 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Copyright (C) 2004-2008 Freescale Semiconductor, Inc. * TsiChung Liew (Tsi-Chung.Liew@freescale.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 */ #include @@ -186,7 +169,7 @@ int mii_discover_phy(struct eth_device *dev) printf("PHY @ 0x%x pass %d\n", phyno, pass); #endif - for (i = 0; (i < (sizeof(phyinfo) / sizeof(phy_info_t))) + for (i = 0; (i < ARRAY_SIZE(phyinfo)) && (phyinfo[i].phyid != 0); i++) { if (phyinfo[i].phyid == phytype) { #ifdef ET_DEBUG @@ -293,8 +276,7 @@ void __mii_init(void) * Otherwise they hang in mii_send() !!! Sorry! */ -int mcffec_miiphy_read(const char *devname, unsigned char addr, unsigned char reg, - unsigned short *value) +int mcffec_miiphy_read(struct mii_dev *bus, int addr, int devad, int reg) { short rdreg; /* register working value */ @@ -303,28 +285,22 @@ int mcffec_miiphy_read(const char *devname, unsigned char addr, unsigned char re #endif rdreg = mii_send(mk_mii_read(addr, reg)); - *value = rdreg; - #ifdef MII_DEBUG - printf("0x%04x\n", *value); + printf("0x%04x\n", rdreg); #endif - return 0; + return rdreg; } -int mcffec_miiphy_write(const char *devname, unsigned char addr, unsigned char reg, - unsigned short value) +int mcffec_miiphy_write(struct mii_dev *bus, int addr, int devad, int reg, + u16 value) { #ifdef MII_DEBUG - printf("miiphy_write(0x%x) @ 0x%x = ", reg, addr); + printf("miiphy_write(0x%x) @ 0x%x = 0x%04x\n", reg, addr, value); #endif mii_send(mk_mii_write(addr, reg, value)); -#ifdef MII_DEBUG - printf("0x%04x\n", value); -#endif - return 0; }