X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fphy%2Fgeneric_10g.c;h=b4384e1f7818dcb2c9434a0475e2ccf2fd944673;hb=1d63ec3fa40e4899ad1d74d5ed3c926acfda54f2;hp=315c50867dfdda864996574f1897f0d6d9dc5782;hpb=aef293bc85dad4f8d645e46d723606a747236a60;p=oweals%2Fu-boot.git diff --git a/drivers/net/phy/generic_10g.c b/drivers/net/phy/generic_10g.c index 315c50867d..b4384e1f78 100644 --- a/drivers/net/phy/generic_10g.c +++ b/drivers/net/phy/generic_10g.c @@ -1,29 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Generic PHY Management code * - * 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 - * - * * Copyright 2011 Freescale Semiconductor, Inc. * author Andy Fleming * * Based loosely off of Linux's PHY Lib */ - -#include #include #include #include @@ -36,7 +19,7 @@ int gen10g_shutdown(struct phy_device *phydev) int gen10g_startup(struct phy_device *phydev) { int devad, reg; - u32 mmd_mask = phydev->mmds; + u32 mmd_mask = phydev->mmds & MDIO_DEVS_LINK; phydev->link = 1; @@ -44,8 +27,12 @@ int gen10g_startup(struct phy_device *phydev) phydev->speed = SPEED_10000; phydev->duplex = DUPLEX_FULL; + /* + * Go through all the link-reporting devices, and make sure + * they're all up and happy + */ for (devad = 0; mmd_mask; devad++, mmd_mask = mmd_mask >> 1) { - if (!mmd_mask & 1) + if (!(mmd_mask & 1)) continue; /* Read twice because link state is latched and a @@ -102,4 +89,3 @@ struct phy_driver gen10g_driver = { .startup = gen10g_startup, .shutdown = gen10g_shutdown, }; -