From patchwork Sun Sep 4 18:23:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 9312713 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 CF8A7600CA for ; Sun, 4 Sep 2016 18:25:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6A292887A for ; Sun, 4 Sep 2016 18:25:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB2CB2887D; Sun, 4 Sep 2016 18:25:27 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7E3F62887A for ; Sun, 4 Sep 2016 18:25:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bgc5M-00064g-Mm; Sun, 04 Sep 2016 18:24:04 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bgc54-0005uX-HL; Sun, 04 Sep 2016 18:23:47 +0000 Received: by mail-wm0-x244.google.com with SMTP id c133so10170656wmd.2; Sun, 04 Sep 2016 11:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9/toyRh2BvS8W/D+lSjvBvyxh16pIq+0cjWQQ5Kj+KM=; b=U7QPz2vF3WD4TM0Bwmcpx+hCSR5aPGmWdgUjh+ccDG52Lhpvf2o9XdkuatBMRdcbwg t4dteO2jMjI0JHDPmUvMiKTXIEEcxAERBOpy+TYnQ+SBtWAebxbRM1hSMQ1BeBR0CNie Qauf0oW04sO2TVIzHGr1vjXdWRof2d8gQrLGsjt6yEHVs0z3XW2j7NQyo87j1faRvAJ4 T4HuXqO0DJFXMZh4vKB3tRfCxJ0V5UlGYBvL8DFX0n0psCzFH6oaWsRrXicBFZAARC6K eRB4DmFhEtCeWqmCMsM3ZT9Qlo7FgnveGMKp688rr0rMFlEERT4iomNPZIfQRAldOPzY gjQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9/toyRh2BvS8W/D+lSjvBvyxh16pIq+0cjWQQ5Kj+KM=; b=YCUlMHYN8xeifsSF0P55YtEcCUNR/JuKlfBF/m2T1YRL3JklKapZhUJ3K1z13DiNIX GzuQ/DY2PzHNjR10+hY6/inE/rHmbYcmzjXuPNs3mEPVOXFtge9aYC8P01WlH7/x6UCP n3E+AKFz9gLMn0AuVp0vxaivpDOroKBqk6TrpJiZaP2YAM3OTL3AnF3A5bqcd7DTQEdD 1AMXwxujkUnhWUdvu+W0P9nnUw+oAFhEbIfSEivud57OH05BiFPEaCOfOKgrjsGlHd5c seviK44MqT6c12lNb8g6VV4XD7ntCjbxERAXKf+3f9INxNL+Q/3cgjEJtDNTY1J52KK2 qWFA== X-Gm-Message-State: AE9vXwPl1xntq7ZzNxzdL0GzOt98YGSqfm3YBiP18znMwTS67iPZd5jVHPwWf2roE86FIA== X-Received: by 10.194.97.129 with SMTP id ea1mr12760959wjb.107.1473013409262; Sun, 04 Sep 2016 11:23:29 -0700 (PDT) Received: from blackbox.darklights.net (p200300DCD3CA8104A82AA8E503619161.dip0.t-ipconnect.de. [2003:dc:d3ca:8104:a82a:a8e5:361:9161]) by smtp.googlemail.com with ESMTPSA id cw7sm22669012wjb.38.2016.09.04.11.23.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Sep 2016 11:23:28 -0700 (PDT) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, khilman@baylibre.com, carlo@caione.org, mturquette@baylibre.com, peppe.cavallaro@st.com, alexandre.torgue@st.com Subject: [PATCH v4 3/5] stmmac: introduce get_stmmac_bsp_priv() helper Date: Sun, 4 Sep 2016 20:23:18 +0200 Message-Id: <20160904182320.671-4-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160904182320.671-1-martin.blumenstingl@googlemail.com> References: <20160828161637.9941-1-martin.blumenstingl@googlemail.com> <20160904182320.671-1-martin.blumenstingl@googlemail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160904_112346_769298_2ECF05B4 X-CRM114-Status: UNSURE ( 8.04 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, arnd@arndb.de, catalin.marinas@arm.com, manabian@gmail.com, will.deacon@arm.com, davem@davemloft.net, robh+dt@kernel.org, netdev@vger.kernel.org, sboyd@codeaurora.org, linux-arm-kernel@lists.infradead.org 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 From: Joachim Eastwood Create a helper to retrive dwmac private data from a dev pointer. This is useful in PM callbacks and driver remove. Signed-off-by: Joachim Eastwood Tested-by: Martin Blumenstingl Acked-by: David S. Miller --- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h index ffeb8d9..64e147f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h @@ -30,4 +30,12 @@ int stmmac_get_platform_resources(struct platform_device *pdev, int stmmac_pltfr_remove(struct platform_device *pdev); extern const struct dev_pm_ops stmmac_pltfr_pm_ops; +static inline void *get_stmmac_bsp_priv(struct device *dev) +{ + struct net_device *ndev = dev_get_drvdata(dev); + struct stmmac_priv *priv = netdev_priv(ndev); + + return priv->plat->bsp_priv; +} + #endif /* __STMMAC_PLATFORM_H__ */