Received: by 10.192.165.156 with SMTP id m28csp801655imm; Thu, 19 Apr 2018 07:48:32 -0700 (PDT) X-Google-Smtp-Source: AIpwx48bIvwBfBgs/v+Ivmpj3BKrI28hoNG1SJGmkcRXk9cFPbOfqxaTtmX0W+aAFHW+QlHVdySu X-Received: by 10.101.99.6 with SMTP id g6mr5400307pgv.173.1524149312803; Thu, 19 Apr 2018 07:48:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524149312; cv=none; d=google.com; s=arc-20160816; b=OLaUXM8XT9YWBoRGdSN88GaQ/Q29Fj6Ub13qHvzsWB1uq9okE4K+/hXt3Es2v4vIjH kTcNbKCWL2N72eOGoFn+gKWu6ZgkHlWJpLUBIHqyTn08TcypGPQ0C1DgJooytau6phvM Qu8DqA2cpkASciXZ5MxDUWMdO1Es4Mmy/sneJbDtSaEsIb1kqgIcwaBxYh0uZP/ukWj9 4houQKAfYkd4oQN2oUH4NRmuJRfgX/giW/Ch5GVmt0TdccKNa5OrJDpSPVPP2iwhlABG iYQyddxZ1LEEOhK8CYo06M58h3+mlUwg9rGm+VJrkQnZn7G0kzpmCZ9CxEMIHbJ1Z8Wj XHQQ== 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=TYUEPF19swx/kGJEasQR0d8cbZ3rcocQwZHFP7JMuXk=; b=xMclB3dFHsoHmJgGTVp985vhv8YT3NErtQ7v1SdAxCXB+jyOldhgQt7GJDvg+f89/w LfQgCClFNGrdFWt+UmR5/aY8xiqfNamsXQ2KrQEBAVKKPDmgIUI60Veb8fgefCXihcMW HGH65rK95pd+HIw0wApuXuBqs6gYMhKuLIX5s012LHbe3alNfU/BrriFo9m3RpFNZ86M l4iAw7Y69f5RZljZDGLH6MkP8tJy+gIRRXjqHWM27c3IuF+/u+fpL8cUxVALVMr+ieZZ lYKxe911V81zC7kzqFEBvNZCJ9r8Hw00a/b82y2YPLRzo4LjDO64P2EvyXIyrmb/vfrx 8Uqg== 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 m9si3406678pff.80.2018.04.19.07.48.18; Thu, 19 Apr 2018 07:48:32 -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 S1753879AbeDSOM5 (ORCPT + 99 others); Thu, 19 Apr 2018 10:12:57 -0400 Received: from sauhun.de ([88.99.104.3]:45350 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753002AbeDSOHK (ORCPT ); Thu, 19 Apr 2018 10:07:10 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id 2F7A43139B0; Thu, 19 Apr 2018 16:07:09 +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 , Mark Brown , Michal Simek , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 46/61] spi: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:06:16 +0200 Message-Id: <20180419140641.27926-47-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/spi/spi-cadence.c | 6 ++---- drivers/spi/spi-zynqmp-gqspi.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-cadence.c b/drivers/spi/spi-cadence.c index 5c9516ae4942..de394422b611 100644 --- a/drivers/spi/spi-cadence.c +++ b/drivers/spi/spi-cadence.c @@ -686,8 +686,7 @@ static int cdns_spi_remove(struct platform_device *pdev) */ static int __maybe_unused cdns_spi_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct spi_master *master = platform_get_drvdata(pdev); + struct spi_master *master = dev_get_drvdata(dev); return spi_master_suspend(master); } @@ -702,8 +701,7 @@ static int __maybe_unused cdns_spi_suspend(struct device *dev) */ static int __maybe_unused cdns_spi_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct spi_master *master = platform_get_drvdata(pdev); + struct spi_master *master = dev_get_drvdata(dev); struct cdns_spi *xspi = spi_master_get_devdata(master); cdns_spi_init_hw(xspi); diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c index 18aeaceee286..3608db4ff368 100644 --- a/drivers/spi/spi-zynqmp-gqspi.c +++ b/drivers/spi/spi-zynqmp-gqspi.c @@ -918,8 +918,7 @@ static int zynqmp_qspi_start_transfer(struct spi_master *master, */ static int __maybe_unused zynqmp_qspi_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct spi_master *master = platform_get_drvdata(pdev); + struct spi_master *master = dev_get_drvdata(dev); spi_master_suspend(master); @@ -939,8 +938,7 @@ static int __maybe_unused zynqmp_qspi_suspend(struct device *dev) */ static int __maybe_unused zynqmp_qspi_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct spi_master *master = platform_get_drvdata(pdev); + struct spi_master *master = dev_get_drvdata(dev); struct zynqmp_qspi *xqspi = spi_master_get_devdata(master); int ret = 0; -- 2.11.0