From patchwork Mon Sep 5 17:24:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 113413 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id A38D6B6F7F for ; Tue, 6 Sep 2011 03:31:37 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6BB5328122; Mon, 5 Sep 2011 19:31:20 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wUDXg-6zYLyw; Mon, 5 Sep 2011 19:31:20 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A901C280A1; Mon, 5 Sep 2011 19:31:08 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8003D280A1 for ; Mon, 5 Sep 2011 19:31:05 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZkIIhKDsVufR for ; Mon, 5 Sep 2011 19:31:04 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail.mleia.com (li271-223.members.linode.com [178.79.152.223]) by theia.denx.de (Postfix) with ESMTPS id 1776E280A4 for ; Mon, 5 Sep 2011 19:31:01 +0200 (CEST) From: Vladimir Zapolskiy To: u-boot@lists.denx.de Date: Mon, 5 Sep 2011 20:24:07 +0300 Message-Id: <1315243448-29959-2-git-send-email-vz@mleia.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1315243448-29959-1-git-send-email-vz@mleia.com> References: <1315243448-29959-1-git-send-email-vz@mleia.com> Subject: [U-Boot] [PATCH 1/2] phylib: reset mii bus only if reset handler is registered X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This change allows to cope with a mii bus device registered using miiphy_register(), which doesn't assign a default reset handler. Signed-off-by: Vladimir Zapolskiy Acked-by: Detlev Zundel --- drivers/net/phy/phy.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index ce69c19..8da7688 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -692,7 +692,8 @@ struct phy_device *phy_connect(struct mii_dev *bus, int addr, struct phy_device *phydev; /* Reset the bus */ - bus->reset(bus); + if (bus->reset) + bus->reset(bus); /* Wait 15ms to make sure the PHY has come out of hard reset */ udelay(15000);