Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2346807imm; Thu, 7 Jun 2018 09:08:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKxrduEJBk66GuasA8WFydaxLlqsS9zCRXA4j+XbFvunnHo9LwFV6ZJc1wFLlPkbnfEejCd X-Received: by 2002:a17:902:9b83:: with SMTP id y3-v6mr2608812plp.358.1528387681415; Thu, 07 Jun 2018 09:08:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528387681; cv=none; d=google.com; s=arc-20160816; b=mAkPU8vmfhY9Hw7gPxri+ZrlhxV8PUg1hVdzwyZpNurhgzCXozDuq2c32jtPF/wBcV T2Bq+3mXUeNLXjYZNEUIePVB5oKe4uZEyucuk67SuD9aQJCSnCIrvPahlD1Pe8XD6REq BtLvd6ZGE+e4ugBxuAhcW1r4kPirY0UGjpx/mHt87RojQp7EJZZIv19x+li6BZifiriI ywHv/5eowti2FCE+TI4ZravMBKsRjlVHqhVl/kIZRRBCNoQShJsKM2+7GPimVZGHT5of cVmBHGWsUu4FV90YKjRtV9AHChObmnOuQUdyGM7FnArWIL8BKzxZhzpgOkikm+ffc7L4 rbJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=sJGeCK2gVsUCLx7hxPXJeZqnG9oR1Dgx9KkSs32QoS0=; b=gZn8ZCUGkIqIvfuI1Xxup3zegqRJSLS4GaWFKMiKsQQPRkOkiPHrSLdADJqKyWpSiL upscgVkHVsxl0L0khQF81qEGMdBZhzzkDuUKyThEaWeJmbK7eAhqOa+ko35T4lectEWY D7NUnOBoEom2V3KRD10p7kO+NCgAxmTNkX4xuPWNsyl4rhTjIStkU/DV5Ngkw8xUSsiT AuZlumj+rQsO3Vi41FWtn88yFnLoKFADUXq/VwBidHBCkBT7rMiyeTMi1bH13LCikl3g 9my7QNe/xjed8BvD/c2Uw0Ey7ueFET0204XhX2QHr52zXF4mnOpVK9OXFjLE+QiF0Ufm dQyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f18-v6si17286823plj.571.2018.06.07.09.07.46; Thu, 07 Jun 2018 09:08:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936044AbeFGQGg (ORCPT + 99 others); Thu, 7 Jun 2018 12:06:36 -0400 Received: from secvs01.rockwellcollins.com ([205.175.225.240]:49607 "EHLO secvs01.rockwellcollins.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935284AbeFGQGX (ORCPT ); Thu, 7 Jun 2018 12:06:23 -0400 X-Greylist: delayed 575 seconds by postgrey-1.27 at vger.kernel.org; Thu, 07 Jun 2018 12:06:23 EDT Received: from ofwgwc03.rockwellcollins.com (HELO ciulimr02.rockwellcollins.com) ([205.175.225.12]) by secvs01.rockwellcollins.com with ESMTP; 07 Jun 2018 10:56:46 -0500 X-Received: from righttwix.rockwellcollins.com (righttwix.rockwellcollins.com [192.168.141.218]) by ciulimr02.rockwellcollins.com (Postfix) with ESMTP id B655220094; Thu, 7 Jun 2018 10:56:46 -0500 (CDT) From: Brandon Maier To: netdev@vger.kernel.org Cc: andrew@lunn.ch, f.fainelli@gmail.com, davem@davemloft.net, michal.simek@xilinx.com, clayton.shotwell@rockwellcollins.com, kristopher.cory@rockwellcollins.com, linux-kernel@vger.kernel.org, Brandon Maier Subject: [PATCH 2/3] net: phy: xgmiitorgmii: Use correct mdio bus Date: Thu, 7 Jun 2018 10:53:47 -0500 Message-Id: <20180607155348.149665-2-brandon.maier@rockwellcollins.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180607155348.149665-1-brandon.maier@rockwellcollins.com> References: <20180607155348.149665-1-brandon.maier@rockwellcollins.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The xgmiitorgmii is using the mii_bus of the device it's attached too, instead of the bus it was given during probe. Signed-off-by: Brandon Maier --- drivers/net/phy/xilinx_gmii2rgmii.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/phy/xilinx_gmii2rgmii.c b/drivers/net/phy/xilinx_gmii2rgmii.c index 04c8bec1c4c1..d6f8b64cddbe 100644 --- a/drivers/net/phy/xilinx_gmii2rgmii.c +++ b/drivers/net/phy/xilinx_gmii2rgmii.c @@ -33,17 +33,19 @@ struct gmii2rgmii { struct phy_device *phy_dev; struct phy_driver *phy_drv; struct phy_driver conv_phy_drv; - int addr; + struct mdio_device *mdio; }; static int xgmiitorgmii_read_status(struct phy_device *phydev) { struct gmii2rgmii *priv = phydev->priv; + struct mii_bus *bus = priv->mdio->bus; + int addr = priv->mdio->addr; u16 val = 0; priv->phy_drv->read_status(phydev); - val = mdiobus_read(phydev->mdio.bus, priv->addr, XILINX_GMII2RGMII_REG); + val = mdiobus_read(bus, addr, XILINX_GMII2RGMII_REG); val &= ~XILINX_GMII2RGMII_SPEED_MASK; if (phydev->speed == SPEED_1000) @@ -53,7 +55,7 @@ static int xgmiitorgmii_read_status(struct phy_device *phydev) else val |= BMCR_SPEED10; - mdiobus_write(phydev->mdio.bus, priv->addr, XILINX_GMII2RGMII_REG, val); + mdiobus_write(bus, addr, XILINX_GMII2RGMII_REG, val); return 0; } @@ -86,7 +88,7 @@ static int xgmiitorgmii_probe(struct mdio_device *mdiodev) return -EPROBE_DEFER; } - priv->addr = mdiodev->addr; + priv->mdio = mdiodev; priv->phy_drv = priv->phy_dev->drv; memcpy(&priv->conv_phy_drv, priv->phy_dev->drv, sizeof(struct phy_driver)); -- 2.14.3