From patchwork Thu Apr 19 14:05:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 10350981 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 64EFD6023A for ; Thu, 19 Apr 2018 14:50:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5458428A42 for ; Thu, 19 Apr 2018 14:50:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4854B28A44; Thu, 19 Apr 2018 14:50:42 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable 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 1DE3B28A42 for ; Thu, 19 Apr 2018 14:50:41 +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=zxoHCzNY0BQXVNVi+RUDnvZiosywFgYUoU1mELXOOQM=; b=hsPiu/udXwX7aJpZLw57v+pIVJ HaEaNIImh9o2ZONtWheJiMKoeIIFytG/71ofzWwa53ZC5CmqB8txkzK5GHGio7vdM62TcgX9MOkx7 /omlCljoBpZSw+RNOdculR+EkY22qNRVQ5zaTYQrcl1ArNar3zDlZJe/c9n94syp8yWpSjHjvjjjc UWTlPGB/RS7uUxLAEeUlp1cBMb+sesRXRRAq9b+S3ugkN5zMR4ydts+3h0p8iMDjz2fBHf+Ac0ZI5 Bz251mVCNELeqahbW8cP4pcErQfSGGnn3BI8YVTnz1JnVj7vCvUteL1aLCkYlYdgrUrDGSfQ11Dwp mGI7PkKw==; 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 1f9AtM-0002JI-G7; Thu, 19 Apr 2018 14:50:32 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f9Ad5-0006or-5W for linux-arm-kernel@bombadil.infradead.org; Thu, 19 Apr 2018 14:33:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=U4vDvrvC+MimroaOTJinUkeSWUZGj0yehVb4miCnVz0=; b=O/Kxef5fbOQGe6oOftvrxmzL5 qqApIFMFE8k2s5nWWixp5ljIxncFTMEbda1LFdngxh3GMhNmpAm2Q+qfVc4IlPzBSIXoVwU1EfJVV wVBtfGBepGbYFLTB27vbHQYqXSa/chyMngGeAITJJ9G6CQ+DCf68AQx6GkVqrAVZp9TH37c5BL1px 6zLWpMEXmuhkXeRNwwe1e6bf01eTWpOqw1YBDAvSywf5eKDr2tO2wKvnu/plReI4D327bh/gYbdYP 0xpowVQRBURh/B5gb09XpyvznI4G1SWwVLGHAdC9CmuJwc7htTW6dv7q3pMkHfRmtINGk7NeF/NSc 2Swtd3fGg==; Received: from sauhun.de ([88.99.104.3] helo=pokefinder.org) by merlin.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f9ADI-0005W9-LN for linux-arm-kernel@lists.infradead.org; Thu, 19 Apr 2018 14:07:06 +0000 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id DDE503139B2; Thu, 19 Apr 2018 16:06:49 +0200 (CEST) From: Wolfram Sang To: linux-kernel@vger.kernel.org Subject: [PATCH 06/61] crypto: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:05:36 +0200 Message-Id: <20180419140641.27926-7-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> References: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180419_100704_818850_63C9CFE8 X-CRM114-Status: GOOD ( 12.32 ) 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: linux-samsung-soc@vger.kernel.org, Herbert Xu , kernel-janitors@vger.kernel.org, Krzysztof Kozlowski , linux-renesas-soc@vger.kernel.org, Wolfram Sang , Kukjin Kim , linux-crypto@vger.kernel.org, Jamie Iles , "David S. Miller" , 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 We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang Reviewed-by: Krzysztof Kozlowski --- Build tested only. buildbot is happy. Please apply individually. drivers/crypto/exynos-rng.c | 6 ++---- drivers/crypto/picoxcell_crypto.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/exynos-rng.c b/drivers/crypto/exynos-rng.c index 86f5f459762e..2cfabb99cb6e 100644 --- a/drivers/crypto/exynos-rng.c +++ b/drivers/crypto/exynos-rng.c @@ -319,8 +319,7 @@ static int exynos_rng_remove(struct platform_device *pdev) static int __maybe_unused exynos_rng_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct exynos_rng_dev *rng = platform_get_drvdata(pdev); + struct exynos_rng_dev *rng = dev_get_drvdata(dev); int ret; /* If we were never seeded then after resume it will be the same */ @@ -350,8 +349,7 @@ static int __maybe_unused exynos_rng_suspend(struct device *dev) static int __maybe_unused exynos_rng_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct exynos_rng_dev *rng = platform_get_drvdata(pdev); + struct exynos_rng_dev *rng = dev_get_drvdata(dev); int ret; /* Never seeded so nothing to do */ diff --git a/drivers/crypto/picoxcell_crypto.c b/drivers/crypto/picoxcell_crypto.c index a4df966adbf6..321d5e2ac833 100644 --- a/drivers/crypto/picoxcell_crypto.c +++ b/drivers/crypto/picoxcell_crypto.c @@ -1169,8 +1169,7 @@ static void spacc_spacc_complete(unsigned long data) #ifdef CONFIG_PM static int spacc_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct spacc_engine *engine = platform_get_drvdata(pdev); + struct spacc_engine *engine = dev_get_drvdata(dev); /* * We only support standby mode. All we have to do is gate the clock to @@ -1184,8 +1183,7 @@ static int spacc_suspend(struct device *dev) static int spacc_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct spacc_engine *engine = platform_get_drvdata(pdev); + struct spacc_engine *engine = dev_get_drvdata(dev); return clk_enable(engine->clk); }