From mboxrd@z Thu Jan 1 00:00:00 1970 From: Troy Kisky Date: Fri, 13 Jan 2012 14:42:03 -0700 Subject: [U-Boot] [PATCH 4/5] net: fec_mxc: Nove autonegoatiate restart after mii_postcall In-Reply-To: <201201131344.56414.marek.vasut@gmail.com> References: <1326456604-25137-1-git-send-email-dirk.behme@de.bosch.com> <1326456604-25137-4-git-send-email-dirk.behme@de.bosch.com> <201201131344.56414.marek.vasut@gmail.com> Message-ID: <4F10A52B.1010501@boundarydevices.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 1/13/2012 5:44 AM, Marek Vasut wrote: >> From: Troy Kisky >> >> Allow boards to change what is advertised before an autoneg >> restart happens. >> >> Signed-off-by: Troy Kisky >> CC: Troy Kisky >> CC: Stefano Babic >> CC: Marek Vasut >> --- >> drivers/net/fec_mxc.c | 6 +++--- >> 1 files changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c >> index b50e01c..6271df5 100644 >> --- a/drivers/net/fec_mxc.c >> +++ b/drivers/net/fec_mxc.c >> @@ -206,12 +206,12 @@ static int miiphy_restart_aneg(struct eth_device >> *dev) miiphy_write(dev->name, fec->phy_id, MII_ADVERTISE, >> LPA_100FULL | LPA_100HALF | LPA_10FULL | >> LPA_10HALF | PHY_ANLPAR_PSB_802_3); >> - miiphy_write(dev->name, fec->phy_id, MII_BMCR, >> - BMCR_ANENABLE | BMCR_ANRESTART); >> - >> if (fec->mii_postcall) >> ret = fec->mii_postcall(fec->phy_id); >> >> + miiphy_write(dev->name, fec->phy_id, MII_BMCR, >> + BMCR_ANENABLE | BMCR_ANRESTART); >> + >> return ret; >> } > I think this might break boards using the mii_postcall. > Since only 3 boards use this. Perhaps I should code as if (fec->mii_start_aneg_call) ret = fec->mii_start_aneg_call(fec->phy_id); else miiphy_write(dev->name, fec->phy_id, MII_BMCR, BMCR_ANENABLE | BMCR_ANRESTART); and copy the miiphy_write(dev->name, fec->phy_id, MII_BMCR, BMCR_ANENABLE | BMCR_ANRESTART); into all three callbacks? Troy