From patchwork Thu Apr 19 14:06:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 901173 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40Rgt851LGz9s1l for ; Fri, 20 Apr 2018 00:12:32 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753519AbeDSOMR (ORCPT ); Thu, 19 Apr 2018 10:12:17 -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-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@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 Acked-by: Marc Dietrich --- 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);