Received: by 10.192.165.156 with SMTP id m28csp761469imm; Thu, 19 Apr 2018 07:10:39 -0700 (PDT) X-Google-Smtp-Source: AIpwx48PsE3vf6t3SdtbMV07ouKEEklPbp0D35pbQbfC+fOeSyAPcHApMQkf/E3lzwlObxkVUhP6 X-Received: by 2002:a17:902:74c3:: with SMTP id f3-v6mr6327030plt.7.1524147039533; Thu, 19 Apr 2018 07:10:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524147039; cv=none; d=google.com; s=arc-20160816; b=uAa8NKDVfjOE9oRYJvpT6XSkYCsSXm/GObkFhhjRC2qUco5nPLBHN4o8gRySwYVdUf LHnBdEK/KGKZVAscl0Dp9SV/upMEI6YvDOka0bO9v6aUf1bHwULyPtAoTVHRQs5KVh6v P2i9/tE3UkYvcJu4zf8PSRWiY8miDtdpd3zHggm93CPYUwR+JTSX59wtNAvXOL4dlsHc NyU0in4BcdcPCAPvrsV6mtBORFqbOVwpvlGsDGyWTc6yaVpr4I7PVpTd2+2XhBdJYac9 j9oS+m/MC0/mm7vic3CUTlkE90ZKEwTjcGIbQLpuzEIk6rR+4dWCzZ+IO5UTRiEvYlET VT2Q== 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=/o5pVQ46EgTNtuLdf/5D6ROdN1Bfg/XZpzvQ1nqkMWs=; b=u0Jq1d8Rqx7BNilAKUgATm/wtFgqAoihf7gF/jaaA4ZugiRB/QxNlYDi20mUhJrwuR DMiCGBonbv8tFr9OvTnutzD4+lLbZItUyn+Sz1fH3sxWeLg81+0mcXFemchUAcHE9NLd DX9T6x24+I6KvhwghNYvkcXfC4EmC1+oIayCDZZWKQM+4iVAqK7x63cLyNbvxpWDEmgr zSZbhgVrTseoACMSI5ICM0tD3uoznqWM9Z2q8ynq1p80MvHC0LS+f+kgpZn6rKSLGJlL omBbBY9F4J5dVXgIl90lLzAjylsx5K7zMqS/sYwid9fi6RgG6wbTAxf2N22CH2Q0SEwI AFlw== 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 7-v6si3526468plc.164.2018.04.19.07.10.25; Thu, 19 Apr 2018 07:10:39 -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 S1753723AbeDSOIl (ORCPT + 99 others); Thu, 19 Apr 2018 10:08:41 -0400 Received: from sauhun.de ([88.99.104.3]:45270 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752682AbeDSOHQ (ORCPT ); Thu, 19 Apr 2018 10:07:16 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id 1BCA33139DE; Thu, 19 Apr 2018 16:07:15 +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 , Wim Van Sebroeck , Guenter Roeck , Michal Simek , linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 59/61] watchdog: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:06:29 +0200 Message-Id: <20180419140641.27926-60-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/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