Received: by 10.192.165.156 with SMTP id m28csp765316imm; Thu, 19 Apr 2018 07:14:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/9QF2Lg6QF1s0W/Pz5SZwqZNXYmUVo8TITbqbxBTP+PH20wArLghD1LxmfSD0rOTk+VGDq X-Received: by 10.101.97.130 with SMTP id c2mr5438329pgv.219.1524147243042; Thu, 19 Apr 2018 07:14:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524147243; cv=none; d=google.com; s=arc-20160816; b=Dc/gQebQMrTu1vP3Rzqs0ce4qx/y4iOZpa4HI8uk0Ms2pAGag0NPompEL682N6GM5f C8pnKzGeAmglnCFcLeONsyrUeggx9T/7Gc8qFtIkGx3bQpoF3ubqAUyp6x4t98dzAoC9 9WIm+J1tu0SQ9idOKW4UFh0CixTRPk3zjCNoYS3y2Dd9l2KBRyA+7ZjcdIIJgk88eqHR hsgvzDqH4XnLeeKTL1geBua7jt57I7vQxPsVQMCm7JoF2lDlHO1S9m/nsPlQ8b68dZhx YWX4KLvYA9NbbbIzwJaALBEDvkHL3OPx2cC7zM98RA5ZBbUD0U9gsLzLI0m2N8/fs3kE K1Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=tCmcdIUCK8SKzruiBQSIopjwihjl/QgUnnp7RjQHFxI=; b=p2W5xGQofyRl1m+kkAGBoDN4/R+AEFzwtUHCfwA/MGi7aBg2kdt8tMwuqdpZjy8Qfh v288g2sm4LUldD+6LMZF/FQH8D42HPv4HCR/qrJWoe8+8BwX5VR7eb2GmSTH9XepHIwJ 1cuAxlKw2oFDSE6VfJQ2buTJtIZ84DkeWgNxm+L+hojEYqspCIwEVymllvHjIf0kEBwk qh3WfgHOFHLS7FGap7PuhR0lx4vTc/RY3a0Mdjhf3SPpUshB/bqUmuNJr4Zcn7LP92O9 BFkg8mkjLaC3DtnSCmBpqBgVzaQPSgD1k3k46/Add92TWZlfsIDnug3E1d93A1fXAqA2 j4XA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v188si3239742pfv.264.2018.04.19.07.13.47; Thu, 19 Apr 2018 07:14:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753766AbeDSOMS (ORCPT + 99 others); Thu, 19 Apr 2018 10:12:18 -0400 Received: from sauhun.de ([88.99.104.3]:45608 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752530AbeDSOHM (ORCPT ); Thu, 19 Apr 2018 10:07:12 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id 719E33139D6; Thu, 19 Apr 2018 16:07:10 +0200 (CEST) From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, kernel-janitors@vger.kernel.org, Wolfram Sang , Marc Dietrich , Greg Kroah-Hartman , ac100@lists.launchpad.net, linux-tegra@vger.kernel.org, devel@driverdev.osuosl.org Subject: [PATCH 49/61] staging: nvec: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:06:19 +0200 Message-Id: <20180419140641.27926-50-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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang --- Build tested only. buildbot is happy. Please apply individually. drivers/staging/nvec/nvec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index 52054a528723..2a5e0dcf4162 100644 --- a/drivers/staging/nvec/nvec.c +++ b/drivers/staging/nvec/nvec.c @@ -925,8 +925,7 @@ static int tegra_nvec_remove(struct platform_device *pdev) static int nvec_suspend(struct device *dev) { int err; - struct platform_device *pdev = to_platform_device(dev); - struct nvec_chip *nvec = platform_get_drvdata(pdev); + struct nvec_chip *nvec = dev_get_drvdata(dev); struct nvec_msg *msg; char ap_suspend[] = { NVEC_SLEEP, AP_SUSPEND }; @@ -946,8 +945,7 @@ static int nvec_suspend(struct device *dev) static int nvec_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct nvec_chip *nvec = platform_get_drvdata(pdev); + struct nvec_chip *nvec = dev_get_drvdata(dev); dev_dbg(nvec->dev, "resuming\n"); tegra_init_i2c_slave(nvec); -- 2.11.0