Return-Path: Received: from mail-wm0-f65.google.com ([74.125.82.65]:51118 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932136AbeCKOAo (ORCPT ); Sun, 11 Mar 2018 10:00:44 -0400 Received: by mail-wm0-f65.google.com with SMTP id w128so11717436wmw.0 for ; Sun, 11 Mar 2018 07:00:44 -0700 (PDT) To: Andrew Lunn , Florian Fainelli Cc: "netdev@vger.kernel.org" From: Heiner Kallweit Subject: [PATCH net-next] net: phy: set link state to down when creating the phy_device Message-ID: Date: Sun, 11 Mar 2018 15:00:37 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org List-ID: Currently the link state is initialized to "up" when the phy_device is being created. This is not consistent with the phy state being initialized to PHY_DOWN. Usually this doen't do any harm because the link state is updated once the PHY reaches state PHY_AN. However e.g. if a LAN port isn't used and the PHY remains down this inconsistency remains and calls to functions like phy_print_status() give false results. Therefore change the initialization to link being down. Signed-off-by: Heiner Kallweit --- drivers/net/phy/phy_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 478405e54..b28532332 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -374,7 +374,7 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, dev->duplex = -1; dev->pause = 0; dev->asym_pause = 0; - dev->link = 1; + dev->link = 0; dev->interface = PHY_INTERFACE_MODE_GMII; dev->autoneg = AUTONEG_ENABLE; -- 2.16.2