Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754782AbbL0P1W (ORCPT ); Sun, 27 Dec 2015 10:27:22 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:57039 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754687AbbL0P1H (ORCPT ); Sun, 27 Dec 2015 10:27:07 -0500 Date: Sun, 27 Dec 2015 07:27:03 -0800 From: Guenter Roeck To: Geliang Tang Cc: Wim Van Sebroeck , linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 09/10] watchdog: cadence_wdt: use to_platform_device() Message-ID: <20151227152703.GA8944@roeck-us.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1606 Lines: 44 On Sun, Dec 27, 2015 at 09:15:47PM +0800, Geliang Tang wrote: > Use to_platform_device() instead of open-coding it. > > Signed-off-by: Geliang Tang Reviewed-by: Guenter Roeck > --- > drivers/watchdog/cadence_wdt.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c > index abf64eb..4dda902 100644 > --- a/drivers/watchdog/cadence_wdt.c > +++ b/drivers/watchdog/cadence_wdt.c > @@ -421,8 +421,7 @@ static void cdns_wdt_shutdown(struct platform_device *pdev) > */ > static int __maybe_unused cdns_wdt_suspend(struct device *dev) > { > - struct platform_device *pdev = container_of(dev, > - struct platform_device, dev); > + struct platform_device *pdev = to_platform_device(dev); > struct cdns_wdt *wdt = platform_get_drvdata(pdev); > > cdns_wdt_stop(&wdt->cdns_wdt_device); > @@ -440,8 +439,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 = container_of(dev, > - struct platform_device, dev); > + struct platform_device *pdev = to_platform_device(dev); > struct cdns_wdt *wdt = platform_get_drvdata(pdev); > > ret = clk_prepare_enable(wdt->clk); > -- > 2.5.0 > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/