From patchwork Tue Dec 11 19:33:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 10724559 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 7E19F15A6 for ; Tue, 11 Dec 2018 19:34:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E2E42ADA3 for ; Tue, 11 Dec 2018 19:34:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5FA742B67E; Tue, 11 Dec 2018 19:34:25 +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 DE7E92ADA3 for ; Tue, 11 Dec 2018 19:34:24 +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=Dpn9GSxqpdRtHYm+SV7GNtN9RXJrYAIrskFPqccG2Mk=; b=rXBDRN7VL4rZ8FIqU3FnFxWyoW zWjdHvDDSNMQZQluB/5whji4mM2JsxHKjMVJ5Ap7PXDTLH54N+69hBYWQAza8ccWN0EZa8RyOZ3GW Wx48WHgQRbxPHN2DBTpUpt8QRq0I+jl8c/tTwphN6ci2uutAJw2YZiZ42Aq25oL4w48mqpI2ka1UW ZtM9KgE9lXlZj1KjSnnCpwHiKEggqL0ct1XkuMDzczMkWjtCRN+YJZGBtEfMMRFHOJpo6LN4LDxPt cLkA5OkClURMUTZR12dN5CZr8egbh2USpai00XVx0WRKhQSndJ5AlxqxrzfoAKirui54IlEW7iWeS NSwtCGtA==; 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 1gWnnU-0000ep-5K; Tue, 11 Dec 2018 19:34:24 +0000 Received: from mout.gmx.net ([212.227.15.15]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWnnG-0000RX-61; Tue, 11 Dec 2018 19:34:12 +0000 Received: from localhost.localdomain ([91.14.83.44]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MBWo2-1ghIBO0hd8-00ATwi; Tue, 11 Dec 2018 20:33:40 +0100 From: Frank Wunderlich To: Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S. Miller" , Matthias Brugger , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 7/7] [DSA] mt7530 add linking to mdio Date: Tue, 11 Dec 2018 20:33:14 +0100 Message-Id: <20181211193314.10695-7-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181211193314.10695-1-frank-w@public-files.de> References: <20181211193314.10695-1-frank-w@public-files.de> X-Provags-ID: V03:K1:/kdyN1LlQRxSXve23iYRsooYQC7XQPE+MLFtGKmyRq6aCx7CaWF FFL6X0ozaLhzOaPZ3eJCcf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nc4iM6WlGlRQAjfas7AGAOkyN8eUI 2HmbsWyYREDqIS90ZVBb4UIoA9nqMg8SBLkwOPO4LB8aXjIlfjpM03JTE+/FJ1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181211_113410_526237_2E7503E5 X-CRM114-Status: UNSURE ( 9.97 ) 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 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;