Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754807AbbL0NTh (ORCPT ); Sun, 27 Dec 2015 08:19:37 -0500 Received: from m50-134.163.com ([123.125.50.134]:49741 "EHLO m50-134.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752426AbbL0NTf (ORCPT ); Sun, 27 Dec 2015 08:19:35 -0500 From: Geliang Tang To: Wim Van Sebroeck , Guenter Roeck Cc: Geliang Tang , linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/10] watchdog: cadence_wdt: use to_platform_device() Date: Sun, 27 Dec 2015 21:15:47 +0800 Message-Id: X-Mailer: git-send-email 2.5.0 In-Reply-To: References: In-Reply-To: References: X-CM-TRANSID: DtGowEAJb0fM5H9WdHKOAA--.12674S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7Gw1xAF48Gw1DCrW3Gw17Wrg_yoW8JrW8pF 4UAayrKrW8GFZ09w4fJw1DZF15t34xKa4fKr10kwsa93s8Ar95JFyrJFyUArs8GFWkC3W3 X3ZrtrykZa12vF7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UGjgxUUUUU= X-Originating-IP: [116.77.145.148] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/xtbByg7dmVO+g0gO0wAAs7 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1424 Lines: 40 Use to_platform_device() instead of open-coding it. Signed-off-by: Geliang Tang --- 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/