Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp5663670imm; Tue, 26 Jun 2018 15:40:35 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLfvugVfRPgYSS7Fq/9q+PwwTKufdPnW3qz7rJvpBQnvm5nBjyruvKBYT7u6jrwIKE12zu2 X-Received: by 2002:a17:902:206:: with SMTP id 6-v6mr3469845plc.294.1530052835113; Tue, 26 Jun 2018 15:40:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530052835; cv=none; d=google.com; s=arc-20160816; b=RxQFyDNfe3IhhiamGnkMYiEuAZYkbLuIlSZGGm0TDJ0AMDJoGUc44LlZfORTDEk9rO 7YW9qXtBHPDkjPHXoSucBxmmZXGnRFWsvZbEusus/USqhvEYSDEZWpYGtrUEyQZet1SB KzIKVI1XQnTP/FRnYGX+MlpPo7gbX3oT1TGknlUhNkRDZexXWTyfSGiohyyq37v3A6Qe uy+3PByIG+M2WAtLgd3s6k3KDIvKd+KqimNKx25E0ZuBzcl6zgtVJ1fVmSt9GHu8Hiyc F1Wc9NlJRvGAuSkFuEgnSUXmYtfYeW7AptM/xVFXfXhRMRGwd4azHKOjhz78Ry/RLC4V DcGA== 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=O5lSg28G9APMKQowPB2p2w4k01Alk48T+/DDCZJIu/I=; b=EtRLODHhtvjyUazIWaN+RmgqhOdog0fJj6f6b0jkaIR0t6pI3tZ2SMorrLE64MMG+r j1xcd8gJXttXIT/7PDmtdsr75l59jTvx0UrIEP05d4vJYxWaxKpVBy7NpEiuCjegn0ev lDhSutonwUyt0yL6ngSIo2/ccKOFHpGIpSObpH62QmA69FXXZnXv2UO49AtpQ/YoYJ/x 9xGk12SjEqW4Pe+Oqxrr3pL+XwuDMLTuwfRBbSkD3+kVg894Zw7cFho6//PSjfKHJZ10 Fp1nOcYmMBhaIzG2nsaI4lQE4LakZj5iUwaLd9ErP3z1TPZkwyyzSkHOTlEsEIfdjosr cGrg== 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 f67-v6si2425615plb.460.2018.06.26.15.40.20; Tue, 26 Jun 2018 15:40:35 -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 S1754723AbeFZRvQ (ORCPT + 99 others); Tue, 26 Jun 2018 13:51:16 -0400 Received: from da1vs03.rockwellcollins.com ([205.175.227.47]:30924 "EHLO da1vs03.rockwellcollins.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754675AbeFZRvP (ORCPT ); Tue, 26 Jun 2018 13:51:15 -0400 Received: from ofwda1n02.rockwellcollins.com (HELO ciulimr02.rockwellcollins.com) ([205.175.227.14]) by da1vs03.rockwellcollins.com with ESMTP; 26 Jun 2018 12:51:14 -0500 X-Received: from righttwix.rockwellcollins.com (righttwix.rockwellcollins.com [192.168.141.218]) by ciulimr02.rockwellcollins.com (Postfix) with ESMTP id 29E1420096; Tue, 26 Jun 2018 12:51:14 -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 net-next v2 2/3] net: phy: xgmiitorgmii: Use correct mdio bus Date: Tue, 26 Jun 2018 12:50:49 -0500 Message-Id: <20180626175050.71165-2-brandon.maier@rockwellcollins.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180626175050.71165-1-brandon.maier@rockwellcollins.com> References: <20180626175050.71165-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 to, instead of the bus it was given during probe. Signed-off-by: Brandon Maier --- v2: - Fix trivial typo in commit message v1: https://marc.info/?l=linux-netdev&m=152838761310537&w=2 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.17.1