From patchwork Tue Nov 17 15:22:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 327795 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3160C2D0E4 for ; Tue, 17 Nov 2020 15:22:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9A89921D7E for ; Tue, 17 Nov 2020 15:22:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730394AbgKQPW3 (ORCPT ); Tue, 17 Nov 2020 10:22:29 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:35279 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728874AbgKQPW3 (ORCPT ); Tue, 17 Nov 2020 10:22:29 -0500 Received: from orion.localdomain ([95.118.38.12]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MwwuJ-1kKDoC0xC7-00yOCQ; Tue, 17 Nov 2020 16:22:15 +0100 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: wim@linux-watchdog.org, linux@roeck-us.net, linux-watchdog@vger.kernel.org Subject: [PATCH 1/3] watchdog: iTCO_wdt: use module_platform_device() macro Date: Tue, 17 Nov 2020 16:22:12 +0100 Message-Id: <20201117152214.32244-1-info@metux.net> X-Mailer: git-send-email 2.11.0 X-Provags-ID: V03:K1:YDt3UYgs0gevj5QPBMD0MFefGjsM1hX2gDTlqeZDv30Ba3Spfh/ LYF6cJSuhyDjlgYUV5+F2ELVKgYTrAS7yWQF7ZaIi5heiYXMz0g8BEi1pkJK8lSBF+sWMPP 7kq9ox1k/VcTJGRNQssbTmP8iZH8ATk+u10M9s86wyHU3UAvJ3vILcZ2dtBqv/W9BZ67epI 1FNcoqtdiwWqEQq78B6FA== X-UI-Out-Filterresults: notjunk:1; V03:K0:uzlam8SNgd0=:hWx/UI/nGfTejdapvDEhfz yo6No6x5TFRzgD8CCRMyE2o29GSV1VT8b/C1KzLYgg7gE7nIf/zsqedvvdoSzjfD5uiHPItot Wt9rzwnHMzzsYpW/OrqgMCBU5fMMxSy4Jx5gKNpluIYNheyxtx/eVybcAL80OrqBxWyQdQi49 TIyOlQ3kX7pjlwFPARFJ7SmMLA7vAfgPdr8N/xf3BEkg01mrIaLhTkmAF/K/x/4/NEP1G8zED X/PG3jKqNbFHKPPA19F49bu1zwkMa9rAtSgxDjB20c06/PgWsEwerNznuOAEbFjMYw9ZylLIu HLtYP9k/yc8jvjCpDrXsj67IuPPN9at0Wyc+RZlWRj6uZeB6jRwcGhnX5XH2r8IFHT2TIHS/s HoK7eA9YHPJQtZ+ITIPT9abRVmGFLHDd/3b+1q3e0FNNtnammBsf9znPjAtxq Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org Reducing init boilerplate by using the module_platform_device macro. Signed-off-by: Enrico Weigelt, metux IT consult --- drivers/watchdog/iTCO_wdt.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c index a370a185a41c..f2ddc8fc71cd 100644 --- a/drivers/watchdog/iTCO_wdt.c +++ b/drivers/watchdog/iTCO_wdt.c @@ -651,21 +651,7 @@ static struct platform_driver iTCO_wdt_driver = { }, }; -static int __init iTCO_wdt_init_module(void) -{ - pr_info("Intel TCO WatchDog Timer Driver v%s\n", DRV_VERSION); - - return platform_driver_register(&iTCO_wdt_driver); -} - -static void __exit iTCO_wdt_cleanup_module(void) -{ - platform_driver_unregister(&iTCO_wdt_driver); - pr_info("Watchdog Module Unloaded\n"); -} - -module_init(iTCO_wdt_init_module); -module_exit(iTCO_wdt_cleanup_module); +module_platform_driver(iTCO_wdt_driver); MODULE_AUTHOR("Wim Van Sebroeck "); MODULE_DESCRIPTION("Intel TCO WatchDog Timer Driver"); From patchwork Tue Nov 17 15:22:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 327794 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A187CC64E69 for ; Tue, 17 Nov 2020 15:22:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 76B90246A4 for ; Tue, 17 Nov 2020 15:22:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387597AbgKQPWb (ORCPT ); Tue, 17 Nov 2020 10:22:31 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:53769 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729290AbgKQPWa (ORCPT ); Tue, 17 Nov 2020 10:22:30 -0500 Received: from orion.localdomain ([95.118.38.12]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N3bnP-1kDZxM3eYV-010b8c; Tue, 17 Nov 2020 16:22:15 +0100 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: wim@linux-watchdog.org, linux@roeck-us.net, linux-watchdog@vger.kernel.org Subject: [PATCH 3/3] watchdog: iTCO_wdt: use pm_ptr() Date: Tue, 17 Nov 2020 16:22:14 +0100 Message-Id: <20201117152214.32244-3-info@metux.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20201117152214.32244-1-info@metux.net> References: <20201117152214.32244-1-info@metux.net> X-Provags-ID: V03:K1:ILCqRf3Jr5YSFwKCf+KSsS7EMZOJHiq2iNx/dWYxG3v2258Gn/9 Tb0RcmbsCI+co0XqoUX4oVhJwUGdAIo2UotZdESAoL9/DmbcT+WBXP4g0Z1om9q5QjywIrp QOV2FbmPNRADMxULVrBlMMvAa8r9qaMrPPkQWHDEfoVFssoM1ubA50RQu/h/8BGeEc0nrJ3 HLeUaj8YYEFXjm/UuWTPQ== X-UI-Out-Filterresults: notjunk:1; V03:K0:em3U6ChGRT4=:gRnQ+ndIpM62BzitS4Aizo WlBq9iDx+lQ2nHLvo1EANzLA2OfTf0y/+ZqFouLMJWQkR+Rb4yboBv6zN0xHOuSU74ysU6rCz l4Mx+0FYUld9uoblLucUIsb8x2ad2QCuYpkfbHae4IjkybS6KzJI40Ts/N8BzC/JQTUp316vT rT2sWBUd5Rs9f8vtBzA1n/4nwkNfbi4GDlMxrBw7t923hsPl2i6HBEDwkAV2DqeYpDKRuiR8L ZcrTx86Jwi1eGl566B2BdxK/vr1A0+74mfZU0jDe/Kk60XYhu5cl8N7EWJ8+qomkgG7dKB6au CQdfmQvofpxTR+6V6lBqstsX/Tt7XDJgAH6vC+HrMD+ilqXJYznAY4nYaS5Ogsk0O2afo48w9 w52JlsuBx+Xh9TPNUvMcdS/0sZN0Fwp0OLdOYvEePokHaHKH/7+aJz2rhm2gI Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org Reduce a little bit of boilerplate by using pm_ptr(). Signed-off-by: Enrico Weigelt, metux IT consult --- drivers/watchdog/iTCO_wdt.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c index edc588a06ae6..660fc262fbc0 100644 --- a/drivers/watchdog/iTCO_wdt.c +++ b/drivers/watchdog/iTCO_wdt.c @@ -636,16 +636,13 @@ static const struct dev_pm_ops iTCO_wdt_pm = { .resume_noirq = iTCO_wdt_resume_noirq, }; -#define ITCO_WDT_PM_OPS (&iTCO_wdt_pm) -#else -#define ITCO_WDT_PM_OPS NULL #endif /* CONFIG_PM_SLEEP */ static struct platform_driver iTCO_wdt_driver = { .probe = iTCO_wdt_probe, .driver = { .name = DRV_NAME, - .pm = ITCO_WDT_PM_OPS, + .pm = pm_ptr(&iTCO_wdt_pm), }, };