From patchwork Fri Dec 14 16:48:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 10731453 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2E570746 for ; Fri, 14 Dec 2018 16:50:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93FF92890F for ; Fri, 14 Dec 2018 16:50:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87D2A2D861; Fri, 14 Dec 2018 16:50:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 24FE82890F for ; Fri, 14 Dec 2018 16:50:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=4VFqUNc2Lv4mB2IjwArUrOTtn6ThDywIno51skR7Yvg=; b=RMX2lQ2pcZgfYSNL5+cwcjOY3d Kv5WOhbDkhbC6wMu9QK9IOuuHYSrUOsLiXphAsbNXzMWSop8DVTC68JdCB0ZGyR8yRh5BX+5LE6/t 0nZyIyjUH/rmof/qJWvcHN+iFdujdPdizGEtuc/mBk4ryivTIYu1mI5UhS2nAoGVZsrKmjHrGdHUR jo+mCp+3F057wO+wVnHSQa3TYKJCXSUCoaNlDkErxyjom8jWBUBHKcFVa7aRWi+SSxwGRnxzYMbc8 mq7Q9XMffDCdFVAjA/X67HjGJpcJOknDCLEi8Yk6+dBTvR416klYnFgAHq+ad9fgooeRAJigQpFYc vBaX5pkg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gXqfX-0000vU-Ob; Fri, 14 Dec 2018 16:50:31 +0000 Received: from mout.gmx.net ([212.227.15.19]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gXqfN-00089t-1S for linux-mediatek@lists.infradead.org; Fri, 14 Dec 2018 16:50:25 +0000 Received: from localhost.localdomain ([91.14.94.237]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M86PB-1hJkLL1hPV-00viY6; Fri, 14 Dec 2018 17:49:14 +0100 From: Frank Wunderlich To: Matthias Brugger , netdev@vger.kernel.org, Sean Wang , Andrew Lunn , linux-mediatek@lists.infradead.org Subject: [PATCH 7/8] net: dsa: mt7530 add linking to mdio Date: Fri, 14 Dec 2018 17:48:46 +0100 Message-Id: <20181214164847.4851-8-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181214164847.4851-1-frank-w@public-files.de> References: <20181214164847.4851-1-frank-w@public-files.de> X-Provags-ID: V03:K1:DOg1IJMsyfHMnSc57Is3TycfnVBOJ/ngDHbLOmqfCCqJAG3DtzI FwtTqvcJU3Me3W1L5faGamJuTfFx2UX9aQvo2csN7Ki1XVRGLaY+B/NisubaWMe8A+PZma5 N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qO9d3mg06wXlD6yNTlB8kwHL/ X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181214_085021_581709_CC967AC6 X-CRM114-Status: UNSURE ( 8.64 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Frank Wunderlich MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP switch (7530) needs to to be linked to mdio-bus based on https://github.com/openwrt/openwrt/blob/master/target/linux/mediatek/patches-4.14/0045-net-dsa-mediatek-turn-into-platform-driver.patch Signed-off-by: Frank Wunderlich --- drivers/net/dsa/mt7530.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index 83669f53cb36..e529bc334459 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -1345,7 +1345,7 @@ static int mt7530_probe(struct mdio_device *mdiodev) { struct mt7530_priv *priv; - struct device_node *dn; + struct device_node *dn, *mdio; dn = mdiodev->dev.of_node; @@ -1392,8 +1392,14 @@ mt7530_probe(struct mdio_device *mdiodev) return PTR_ERR(priv->reset); } } + mdio = of_get_parent(dn); + if (!mdio) + return -EINVAL; + + priv->bus = of_mdio_find_bus(mdio); + if (!priv->bus) + return -EPROBE_DEFER; - priv->bus = mdiodev->bus; priv->dev = &mdiodev->dev; priv->ds->priv = priv; priv->ds->ops = &mt7530_switch_ops;