Received: by 10.192.165.156 with SMTP id m28csp766179imm; Thu, 19 Apr 2018 07:14:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+VolH8cN8fmv/ZlT2qs6N+qgD2j2mJfbJ21yihU79PUdDf3gJWtm+mcUd8N5dhSgg077gj X-Received: by 2002:a17:902:145:: with SMTP id 63-v6mr6310738plb.332.1524147288465; Thu, 19 Apr 2018 07:14:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524147288; cv=none; d=google.com; s=arc-20160816; b=dmHf7X9+M7HHzMo+eDHQZIlW1+VXz58oh3SCQHZIQe+OaRTT5Fe9ojkDZfnPF0b5T4 6q58WI4X9IAtzFBvcCfewRgDwypxj+7UlOM5Ms/nDi3ZZNv+RiR4aJh5L0vO3O14T8za hHzF4PtCsn9dS5xASBzc1WtdWCgD1x/CiYvhxV6ZE5L1LSAP4/YN4yk3YVEr98jNELiT Bxhxo2TvhnGHRE8SQPoFn4oR4v5K3I+VObtLWVlDFUx0b3bf5mRmARfW+/4sI2RlY3Ue vd8LVObhs3ghD+I5yoVmmFvhqm8mw/c3nKcV2aHNXIstNHoPkKhiNmZQ6XyboscZ5ibg HTEg== 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=DBzPg6ntv2DvO+PxXuaan5s/RS7P+5b8Z1V+EuqgMbc=; b=0iUti8bpWwVRuOd+RocQp4ENhMuNhy031y4mtkEc6etNAMjnP60wC3//a108tt70jD /E8JT63AcTVlJqOTopD4PhDpgEYgVNCbbOQmaWF/oUtA7wJsIACmXRGRxznk5Z95H6bj Y25RrV9j3a9ZYVpic2kjWlSMyd2WU6tts1ZOkdep8Q2zAqV7XpohXq+10d9mwcbIV3Sh JFAJ1Zui7yOYwcshivpcBTIATuqJ3MXZSw9jMYO2qClOa8AMm2kBfg7zF35UW+mspxms tuhG9LuP4LEa/u0VXhFFlfbOQSeLAiMeY4W+GeLDt/XQEmJ5HWmlu9QJnGPuyaRPjgod su2Q== 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 u28si1325900pgo.144.2018.04.19.07.14.34; Thu, 19 Apr 2018 07:14:48 -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 S1753564AbeDSOHM (ORCPT + 99 others); Thu, 19 Apr 2018 10:07:12 -0400 Received: from sauhun.de ([88.99.104.3]:45342 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753375AbeDSOHI (ORCPT ); Thu, 19 Apr 2018 10:07:08 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id 52FAA3139D3; Thu, 19 Apr 2018 16:07:07 +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 , Thierry Reding , Nicolas Ferre , Alexandre Belloni , linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 43/61] pwm: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:06:13 +0200 Message-Id: <20180419140641.27926-44-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/pwm/pwm-atmel-tcb.c | 6 ++---- drivers/pwm/pwm-rcar.c | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/pwm/pwm-atmel-tcb.c b/drivers/pwm/pwm-atmel-tcb.c index 4fb1be246c44..0d0f8376bc35 100644 --- a/drivers/pwm/pwm-atmel-tcb.c +++ b/drivers/pwm/pwm-atmel-tcb.c @@ -460,8 +460,7 @@ MODULE_DEVICE_TABLE(of, atmel_tcb_pwm_dt_ids); #ifdef CONFIG_PM_SLEEP static int atmel_tcb_pwm_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct atmel_tcb_pwm_chip *tcbpwm = platform_get_drvdata(pdev); + struct atmel_tcb_pwm_chip *tcbpwm = dev_get_drvdata(dev); void __iomem *base = tcbpwm->tc->regs; int i; @@ -478,8 +477,7 @@ static int atmel_tcb_pwm_suspend(struct device *dev) static int atmel_tcb_pwm_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct atmel_tcb_pwm_chip *tcbpwm = platform_get_drvdata(pdev); + struct atmel_tcb_pwm_chip *tcbpwm = dev_get_drvdata(dev); void __iomem *base = tcbpwm->tc->regs; int i; diff --git a/drivers/pwm/pwm-rcar.c b/drivers/pwm/pwm-rcar.c index 91d11f2e2fef..748f614d5375 100644 --- a/drivers/pwm/pwm-rcar.c +++ b/drivers/pwm/pwm-rcar.c @@ -261,8 +261,7 @@ MODULE_DEVICE_TABLE(of, rcar_pwm_of_table); #ifdef CONFIG_PM_SLEEP static struct pwm_device *rcar_pwm_dev_to_pwm_dev(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct rcar_pwm_chip *rcar_pwm = platform_get_drvdata(pdev); + struct rcar_pwm_chip *rcar_pwm = dev_get_drvdata(dev); struct pwm_chip *chip = &rcar_pwm->chip; return &chip->pwms[0]; -- 2.11.0