From patchwork Sat Feb 4 21:02:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 9555753 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 66A8F602B7 for ; Sat, 4 Feb 2017 21:04:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5757C26E3E for ; Sat, 4 Feb 2017 21:04:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48C6126E51; Sat, 4 Feb 2017 21:04:40 +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=-1.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 D988026E3E for ; Sat, 4 Feb 2017 21:04:39 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ca7VX-0001pv-TJ; Sat, 04 Feb 2017 21:04:31 +0000 Received: from mail-oi0-f68.google.com ([209.85.218.68]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ca7VF-0001TH-7V for linux-arm-kernel@lists.infradead.org; Sat, 04 Feb 2017 21:04:17 +0000 Received: by mail-oi0-f68.google.com with SMTP id w144so3962115oiw.1 for ; Sat, 04 Feb 2017 13:03:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jerAninf6nAimfKRtPX7mn8+zGaN12Exqs+6cE1r8Pg=; b=URkiEgVpnyK0UzXOuBD95Q2Q44Gnf5k9bb9G1ZLG5GP7RgM/C5wnFoHuUMZy/LSsJC 8hdmrOMj2xLEmZ8V8vVLxWkpWtW9dolQwnSOklAvnzKMC1nWk1mNwadAYr/E/bdzKGP2 01BaXP8L/KZvjbsdfmaRGoWJq1WZJl2Z10OA/kcJun4IUaWiFzGb/GCUAZgUAE+xtwl0 dCwtXwKrBFtK9iEQyzcQLZVaeaS3sUAGyWxSPLVz6uGR3gW6rsxhcVahY/Ix4VBAVW2A Ma3pgCyVdCCcPW53K2tcNvpVAzu3WeglIO/3WscA2vyH+LDzBCu0Dc76XU7ncGy8ZTlv Tk+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jerAninf6nAimfKRtPX7mn8+zGaN12Exqs+6cE1r8Pg=; b=BtajISx3OCM5z4Xp22MGdGr0YAN+/70tdZP364x2Ncpeia20cUiko5KC5TFukRL5Q/ Gx62HyE9AfjZojFCWR2em6LCdIJIoERh7br6KXGziIGO/wa7QKv/P9lTGkOfgcnz96TM FnVbY/KafeL0u0uUR1bgsIppIlVtEcua+o7fWtXyC7U5lbY85VKVjF9SDCUrVd5eZI3b RxP6q0tR9gondq1/wyglLuni1wMY7TyiFyPqrU6N0f18SnaUOhY3v/bTFEDrSDiJzTVC wkw/N4XWOtEtvuCDP095c/KEUN+dHwwVmmu30JRnwByHA0qBCtSRlcpLdILM3wv9vhrP L95w== X-Gm-Message-State: AMke39l2ktmkzILPm/Dv/LcVUYZyOu4CRDa5VYunCu8YpB1W3M9y89C8pAOtGtUvAgmfCA== X-Received: by 10.202.85.78 with SMTP id j75mr1881622oib.91.1486242171420; Sat, 04 Feb 2017 13:02:51 -0800 (PST) Received: from bender.lan ([2001:470:d:73f:39c3:cdd:1426:7b44]) by smtp.gmail.com with ESMTPSA id b193sm16808641oii.3.2017.02.04.13.02.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Feb 2017 13:02:50 -0800 (PST) From: Florian Fainelli To: netdev@vger.kernel.org Subject: [PATCH net-next v5 1/4] net: dsa: Rename and export dev_to_net_device() Date: Sat, 4 Feb 2017 13:02:42 -0800 Message-Id: <20170204210245.14812-2-f.fainelli@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170204210245.14812-1-f.fainelli@gmail.com> References: <20170204210245.14812-1-f.fainelli@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170204_130413_401012_536FA1E7 X-CRM114-Status: GOOD ( 11.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Lunn , Florian Fainelli , Jason Cooper , Vivien Didelot , Russell King , open list , Gregory Clement , "David S. Miller" , "moderated list:ARM/Marvell Dove/MV78xx0/Orion SOC support" , Sebastian Hesselbarth MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP In preparation for using this function in net/dsa/dsa2.c, rename the function to make its scope DSA specific, and export it. Signed-off-by: Florian Fainelli --- include/net/dsa.h | 1 + net/dsa/dsa.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/net/dsa.h b/include/net/dsa.h index 2cb77e64d648..4327b0b03293 100644 --- a/include/net/dsa.h +++ b/include/net/dsa.h @@ -428,6 +428,7 @@ struct dsa_switch_driver { void register_switch_driver(struct dsa_switch_driver *type); void unregister_switch_driver(struct dsa_switch_driver *type); struct mii_bus *dsa_host_dev_to_mii_bus(struct device *dev); +struct net_device *dsa_dev_to_net_device(struct device *dev); static inline bool dsa_uses_tagged_protocol(struct dsa_switch_tree *dst) { diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index 619e57a44d1d..5a5f79bbda6f 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c @@ -486,7 +486,7 @@ struct mii_bus *dsa_host_dev_to_mii_bus(struct device *dev) } EXPORT_SYMBOL_GPL(dsa_host_dev_to_mii_bus); -static struct net_device *dev_to_net_device(struct device *dev) +struct net_device *dsa_dev_to_net_device(struct device *dev) { struct device *d; @@ -503,6 +503,7 @@ static struct net_device *dev_to_net_device(struct device *dev) return NULL; } +EXPORT_SYMBOL_GPL(dsa_dev_to_net_device); #ifdef CONFIG_OF static int dsa_of_setup_routing_table(struct dsa_platform_data *pd, @@ -811,7 +812,7 @@ static int dsa_probe(struct platform_device *pdev) dev = pd->of_netdev; dev_hold(dev); } else { - dev = dev_to_net_device(pd->netdev); + dev = dsa_dev_to_net_device(pd->netdev); } if (dev == NULL) { ret = -EPROBE_DEFER;