Received: by 10.192.165.148 with SMTP id m20csp67320imm; Thu, 19 Apr 2018 13:07:53 -0700 (PDT) X-Google-Smtp-Source: AIpwx48/HS4FE2068cbOsZgOBzCotCTOyctnOnzT09a1JPdB7JFsDRhSVDJiIcQd86Yy/OYcvmdf X-Received: by 10.99.182.13 with SMTP id j13mr2570577pgf.451.1524168473785; Thu, 19 Apr 2018 13:07:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524168473; cv=none; d=google.com; s=arc-20160816; b=Pr1oxaXFfUN6MGrefq0k2zqmKUg1juRS9gMK73W7t5B4UIZGRq6OYPcRu8FJ+S+8wS XmKXvNF5U3LBZJKG2YlR9IkgNc5356u0iS+ScB1c285Tt+WyaAwjXu60xAq9QtEaz3HE 7pLBiN5+5MX1mSLpy71Lkh9hQGSDHYxQ6bTH2DVx6I2KMIC27E2QAI8VkmGHqG+C4rnL AL88YPkHRoLjmAhr8lICo7L5hnbe5PDX73D1uvjm/G/lXKWRpyUT0wuPF9SOY+xoc3Ci hiDpmoyx5zm4xw+4cJ6Tec0g6pr80k9nWsxSf2A14Y6YXPOVC6FrtaKl/mfsj+2PzMKY gaPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=q+Sf1sV7y5bJjX4yZUoPcPKrTis63FylNiRSfnhzp3k=; b=AhU1e/cPacrijEPNsK+dhi9FtPjnuJxRCr+n/FG/Qi+dkk/MBtpX+8S2eh3zReOyDP 4csg4UT4I39s2q7XYC5zzttZ0ikQoJ8RAhd89zF75ptOErQ3YrUkK0P65bVkl/zNxHRg 0zZTJBI8M9iwHwuOeDJ5FaFsz9wds3cEqzJC6OX0DJndskZJ0UIFM0BhcQRjQAMvkq0V sn1ej6g9TKXQ2wk7yjAbfwfUbx3YgDc8usut+reKBgUuvtyA7SV7Yy+TDzBK8NDJujTU 2Bwa+QFlit9q9/DJYkDC3R6ZJqAS1bpWBzan6XyzVoT2HbDSqTfT+tUUasfnLKE+DWKW qpNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@roeck-us.net header.s=default header.b=z4LdetId; 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 i128si3930737pfg.343.2018.04.19.13.07.39; Thu, 19 Apr 2018 13:07:53 -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; dkim=fail header.i=@roeck-us.net header.s=default header.b=z4LdetId; 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 S1753370AbeDSUG3 (ORCPT + 99 others); Thu, 19 Apr 2018 16:06:29 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:51065 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753011AbeDSUG1 (ORCPT ); Thu, 19 Apr 2018 16:06:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=In-Reply-To:Content-Type:MIME-Version:References :Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: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=q+Sf1sV7y5bJjX4yZUoPcPKrTis63FylNiRSfnhzp3k=; b=z4LdetIdDxCS5zNheBPRB3hsyk l/xnyC5fmwuJgOu55ciozZk+zObzO0GqbYnOEaOhSIeudHGUqYICZYKnI9TzFAhwBVmpbphmBb0ln 6miB82wvWCYoy5qbE3Mk3nzr3050T0J6mcD8/n6LzPgmvKIOEY0+Axurl2BXn21k8WVcuKy4RoTWk SAAB42q5nAKk6b0e7w26sI0sjUQVxKyLd89k1XVIlP4F4zdfWZaOKktoZSxF/xsau5+3oVAVTCYx8 PyXSXau2egIvF6jxG9K5OTh0CFoTym6St2uG26I9XU6H+uxW2DrOfrTWzCQUn6z8SfGKLO0fNiarZ vu0r41HA==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:58812 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.89) (envelope-from ) id 1f9Fp1-001jmN-SU; Thu, 19 Apr 2018 20:06:24 +0000 Date: Thu, 19 Apr 2018 13:06:23 -0700 From: Guenter Roeck To: Wolfram Sang Cc: linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kernel-janitors@vger.kernel.org, Wim Van Sebroeck , Michal Simek , linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 59/61] watchdog: simplify getting .drvdata Message-ID: <20180419200623.GB24732@roeck-us.net> References: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> <20180419140641.27926-60-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180419140641.27926-60-wsa+renesas@sang-engineering.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 19, 2018 at 04:06:29PM +0200, 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 Reviewed-by: Guenter Roeck > --- > > Build tested only. buildbot is happy. Please apply individually. > > drivers/watchdog/cadence_wdt.c | 6 ++---- > drivers/watchdog/of_xilinx_wdt.c | 6 ++---- > drivers/watchdog/wdat_wdt.c | 6 ++---- > 3 files changed, 6 insertions(+), 12 deletions(-) > > diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c > index 3ec1f418837d..c3924356d173 100644 > --- a/drivers/watchdog/cadence_wdt.c > +++ b/drivers/watchdog/cadence_wdt.c > @@ -418,8 +418,7 @@ static void cdns_wdt_shutdown(struct platform_device *pdev) > */ > static int __maybe_unused cdns_wdt_suspend(struct device *dev) > { > - struct platform_device *pdev = to_platform_device(dev); > - struct cdns_wdt *wdt = platform_get_drvdata(pdev); > + struct cdns_wdt *wdt = dev_get_drvdata(dev); > > if (watchdog_active(&wdt->cdns_wdt_device)) { > cdns_wdt_stop(&wdt->cdns_wdt_device); > @@ -438,8 +437,7 @@ static int __maybe_unused cdns_wdt_suspend(struct device *dev) > static int __maybe_unused cdns_wdt_resume(struct device *dev) > { > int ret; > - struct platform_device *pdev = to_platform_device(dev); > - struct cdns_wdt *wdt = platform_get_drvdata(pdev); > + struct cdns_wdt *wdt = dev_get_drvdata(dev); > > if (watchdog_active(&wdt->cdns_wdt_device)) { > ret = clk_prepare_enable(wdt->clk); > diff --git a/drivers/watchdog/of_xilinx_wdt.c b/drivers/watchdog/of_xilinx_wdt.c > index 4acbe05e27bb..d3f7eb046678 100644 > --- a/drivers/watchdog/of_xilinx_wdt.c > +++ b/drivers/watchdog/of_xilinx_wdt.c > @@ -268,8 +268,7 @@ static int xwdt_remove(struct platform_device *pdev) > */ > static int __maybe_unused xwdt_suspend(struct device *dev) > { > - struct platform_device *pdev = to_platform_device(dev); > - struct xwdt_device *xdev = platform_get_drvdata(pdev); > + struct xwdt_device *xdev = dev_get_drvdata(dev); > > if (watchdog_active(&xdev->xilinx_wdt_wdd)) > xilinx_wdt_stop(&xdev->xilinx_wdt_wdd); > @@ -285,8 +284,7 @@ static int __maybe_unused xwdt_suspend(struct device *dev) > */ > static int __maybe_unused xwdt_resume(struct device *dev) > { > - struct platform_device *pdev = to_platform_device(dev); > - struct xwdt_device *xdev = platform_get_drvdata(pdev); > + struct xwdt_device *xdev = dev_get_drvdata(dev); > int ret = 0; > > if (watchdog_active(&xdev->xilinx_wdt_wdd)) > diff --git a/drivers/watchdog/wdat_wdt.c b/drivers/watchdog/wdat_wdt.c > index 0da9943d405f..56ad19608a9b 100644 > --- a/drivers/watchdog/wdat_wdt.c > +++ b/drivers/watchdog/wdat_wdt.c > @@ -447,8 +447,7 @@ static int wdat_wdt_probe(struct platform_device *pdev) > #ifdef CONFIG_PM_SLEEP > static int wdat_wdt_suspend_noirq(struct device *dev) > { > - struct platform_device *pdev = to_platform_device(dev); > - struct wdat_wdt *wdat = platform_get_drvdata(pdev); > + struct wdat_wdt *wdat = dev_get_drvdata(dev); > int ret; > > if (!watchdog_active(&wdat->wdd)) > @@ -475,8 +474,7 @@ static int wdat_wdt_suspend_noirq(struct device *dev) > > static int wdat_wdt_resume_noirq(struct device *dev) > { > - struct platform_device *pdev = to_platform_device(dev); > - struct wdat_wdt *wdat = platform_get_drvdata(pdev); > + struct wdat_wdt *wdat = dev_get_drvdata(dev); > int ret; > > if (!watchdog_active(&wdat->wdd)) > -- > 2.11.0 >