diff mbox

[char-misc-next,2/5] watchdog: mei_wdt: use module_mei_cl_driver macro

Message ID 1476884011-20645-3-git-send-email-tomas.winkler@intel.com (mailing list archive)
State Accepted
Delegated to: Samuel Ortiz
Headers show

Commit Message

Winkler, Tomas Oct. 19, 2016, 1:33 p.m. UTC
Replace boilerplate driver registration with module_mei_cl_driver macro.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
 drivers/watchdog/mei_wdt.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)

Comments

Guenter Roeck Oct. 20, 2016, 1:49 a.m. UTC | #1
On 10/19/2016 06:33 AM, Tomas Winkler wrote:
> Replace boilerplate driver registration with module_mei_cl_driver macro.
>
> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>

Acked-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/mei_wdt.c | 20 +-------------------
>  1 file changed, 1 insertion(+), 19 deletions(-)
>
> diff --git a/drivers/watchdog/mei_wdt.c b/drivers/watchdog/mei_wdt.c
> index 630bd189f167..116be477c8fd 100644
> --- a/drivers/watchdog/mei_wdt.c
> +++ b/drivers/watchdog/mei_wdt.c
> @@ -699,25 +699,7 @@ static struct mei_cl_driver mei_wdt_driver = {
>  	.remove = mei_wdt_remove,
>  };
>
> -static int __init mei_wdt_init(void)
> -{
> -	int ret;
> -
> -	ret = mei_cldev_driver_register(&mei_wdt_driver);
> -	if (ret) {
> -		pr_err(KBUILD_MODNAME ": module registration failed\n");
> -		return ret;
> -	}
> -	return 0;
> -}
> -
> -static void __exit mei_wdt_exit(void)
> -{
> -	mei_cldev_driver_unregister(&mei_wdt_driver);
> -}
> -
> -module_init(mei_wdt_init);
> -module_exit(mei_wdt_exit);
> +module_mei_cl_driver(mei_wdt_driver);
>
>  MODULE_AUTHOR("Intel Corporation");
>  MODULE_LICENSE("GPL");
>
diff mbox

Patch

diff --git a/drivers/watchdog/mei_wdt.c b/drivers/watchdog/mei_wdt.c
index 630bd189f167..116be477c8fd 100644
--- a/drivers/watchdog/mei_wdt.c
+++ b/drivers/watchdog/mei_wdt.c
@@ -699,25 +699,7 @@  static struct mei_cl_driver mei_wdt_driver = {
 	.remove = mei_wdt_remove,
 };
 
-static int __init mei_wdt_init(void)
-{
-	int ret;
-
-	ret = mei_cldev_driver_register(&mei_wdt_driver);
-	if (ret) {
-		pr_err(KBUILD_MODNAME ": module registration failed\n");
-		return ret;
-	}
-	return 0;
-}
-
-static void __exit mei_wdt_exit(void)
-{
-	mei_cldev_driver_unregister(&mei_wdt_driver);
-}
-
-module_init(mei_wdt_init);
-module_exit(mei_wdt_exit);
+module_mei_cl_driver(mei_wdt_driver);
 
 MODULE_AUTHOR("Intel Corporation");
 MODULE_LICENSE("GPL");