From patchwork Thu Apr 19 14:06:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 10350887 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 D071560231 for ; Thu, 19 Apr 2018 14:39:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF2CB289F5 for ; Thu, 19 Apr 2018 14:39:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3BFB28A02; Thu, 19 Apr 2018 14:39:40 +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=ham 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 01D10289F5 for ; Thu, 19 Apr 2018 14:39:39 +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=GRHw9dcqd3FqMLlfXsLp85osF4gANk683NyrNH+33Gs=; b=eu6ADWCARaofocDr7/BBLqEiWe TFmIfu5ZapRfhuWyNR90Q3rCOKzMYIwttMFHYMzlF6H2ZUR6jXOtcoMcirmAaq69pbvw2DwAUV4hE FPkfu12yTmRx0Bs88bxe1A0sLeccUU2Q8LCJnZCIJOdfa9L4NTN1fn7SgOlfKElUJAbgpEmfjKvJ0 AtFNwOy+spOgzwA9/RRx/qe/9kwUIW9mzLzh3fJey94o3Oo9ooBsiZ+z3ukqVxN1hO8Uy9Bp2lvUE JX1p2uukLQzZL5Jc7hcufvbeOdJiECiNXZ1R/RdFlveFewmBuTYgqndtSKBrRu1O4Na++ZUWazt/z ZCUojqYg==; 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 1f9Aib-0002MC-Qf; Thu, 19 Apr 2018 14:39:25 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f9AcW-00061V-7O for linux-arm-kernel@bombadil.infradead.org; Thu, 19 Apr 2018 14:33:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=DBzPg6ntv2DvO+PxXuaan5s/RS7P+5b8Z1V+EuqgMbc=; b=X1byuvoo/VkNoC8gnuuDn1Jik PxQIpPyylK1j1zL0zhwK4yb541WCNIqmBX7JothZ2fcebIANkMV47FFp4vcZdjChsJ0K6ot8GeMlT hYlpjWTefLU3dSpHadVWBpe4vXTMUxn8k/5g/Oc904mgP1LkbwY0/IuRi3wNXTKaQIy50FcezScbz af9V22hiwxduLIFsIubYaT6UKF+AfylvGivluKZ4lTaiAG3TE9Rut/Yf32ZJ4HqLJfOWkLi+sNlYm v5u5sZnxJDsrZjQ2SPO12hZpw35NTjZQvSQ624ZBQrsgkTvUGM77Cqw2oZ6ICZAKaQPjITBVvhIn0 hE2rlUcGg==; Received: from sauhun.de ([88.99.104.3] helo=pokefinder.org) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f9ADU-0004be-Gg for linux-arm-kernel@lists.infradead.org; Thu, 19 Apr 2018 14:07:20 +0000 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180419_150716_623623_16FA7B78 X-CRM114-Status: GOOD ( 11.95 ) 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-pwm@vger.kernel.org, Alexandre Belloni , kernel-janitors@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Wolfram Sang , Thierry Reding , 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 Acked-by: Nicolas Ferre --- 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];