Received: by 10.192.165.148 with SMTP id m20csp421189imm; Fri, 20 Apr 2018 01:19:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+Y0Im2H/Ke9J9eVXVJrFcf6eH1oiHgCDp0atMILelzxrYZP1ms79nkdCYNBEvSJA4i7Xy4 X-Received: by 2002:a17:902:30f:: with SMTP id 15-v6mr9268792pld.365.1524212396603; Fri, 20 Apr 2018 01:19:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524212396; cv=none; d=google.com; s=arc-20160816; b=P0+kAjcTenVtXj96VV4QVBFgkVuYBZNTB7yDTEBPAkX0Se98ZdcOPqd5mUaPTV9dh9 P5HY7z9phBpV/GVu6BjMUPsFk2nLA47t0gP6QjasJhIDfve81d/aX10jqRIjHs7YqgZF agmjHHyZpr+8pSkbv6xmi8FHfCGkVR/o4A+GxbxmwMkyaBfvgeURHU30mF9xCKXypVPW Zv4Uk22laVK3bln5Xv22DkOb8iu4Ugi0pVClNZ/Zy/EXdqv9hJrzzBtqk5bLNkOPmgLV 4RQf5oCFMFcMIkPFLCjjyWXZAGyyy34hOhNEjXAIfglxWwLimRc4zXyqloDAkuiE5AM2 CDqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :arc-authentication-results; bh=QksCrdYvbr4uBHx1T9zBegAZCuMd0Lm98+YRG4OjNFg=; b=RGns350E0EldHLgfTDIG8uarvWnS2p0xeWWRctKdKDECrVUyTCY+Bd858aqSdalMGB 9rotqM7nrZwSfxEk8CEyutUBXQiSYBVoDMzpHwoR8lfMTq8g2AoP3QY3URvAeChxwvNs i8OwFyjEU+reU/wbjg2xUqJXReo2TYig5YQ/6YxlqniQvyY2ySrBUz+UFJr1Mj6ZJGXn aFDJHQo7e4VNBGpX/JjHNSVA7fBsjMtKwwQrQzsU63Mbenu6vJe7+K7+VV5jac75TIuO Pd0K5/tpN2cUS4aH91y6md17gAHJYYJctH2ltK16NRRgr5kBzfGf/85KlKA4So1sK5sj YvrA== 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 m4-v6si5258261pll.438.2018.04.20.01.19.42; Fri, 20 Apr 2018 01:19:56 -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 S1754228AbeDTISn (ORCPT + 99 others); Fri, 20 Apr 2018 04:18:43 -0400 Received: from esa2.microchip.iphmx.com ([68.232.149.84]:21796 "EHLO esa2.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753777AbeDTISk (ORCPT ); Fri, 20 Apr 2018 04:18:40 -0400 X-IronPort-AV: E=Sophos;i="5.48,469,1517900400"; d="scan'208";a="13367393" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 20 Apr 2018 01:18:39 -0700 Received: from [10.159.245.112] (10.10.76.4) by CHN-SV-EXCH01.mchp-main.com (10.10.76.37) with Microsoft SMTP Server id 14.3.352.0; Fri, 20 Apr 2018 01:18:38 -0700 Subject: Re: [PATCH 43/61] pwm: simplify getting .drvdata To: Wolfram Sang , CC: , , Thierry Reding , Alexandre Belloni , , References: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> <20180419140641.27926-44-wsa+renesas@sang-engineering.com> From: Nicolas Ferre Organization: microchip Message-ID: Date: Fri, 20 Apr 2018 10:17:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180419140641.27926-44-wsa+renesas@sang-engineering.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/04/2018 at 16:06, Wolfram Sang wrote: > 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]; > -- Nicolas Ferre