nfc: mei: use module_mei_cl_driver macro
authorTomas Winkler <tomas.winkler@intel.com>
Wed, 19 Oct 2016 13:33:29 +0000 (16:33 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Oct 2016 12:21:21 +0000 (08:21 -0400)
Replace boilerplate driver registration with module_mei_cl_driver
macro in pn544 and microread devices.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nfc/microread/mei.c
drivers/nfc/pn544/mei.c

index 3092501f26c4ffbff41162c68fc182b876530a2f..eb5eddf1794e21598eb27f0bd93df5cc65f91842 100644 (file)
@@ -82,28 +82,7 @@ static struct mei_cl_driver microread_driver = {
        .remove = microread_mei_remove,
 };
 
-static int microread_mei_init(void)
-{
-       int r;
-
-       pr_debug(DRIVER_DESC ": %s\n", __func__);
-
-       r = mei_cldev_driver_register(&microread_driver);
-       if (r) {
-               pr_err(MICROREAD_DRIVER_NAME ": driver registration failed\n");
-               return r;
-       }
-
-       return 0;
-}
-
-static void microread_mei_exit(void)
-{
-       mei_cldev_driver_unregister(&microread_driver);
-}
-
-module_init(microread_mei_init);
-module_exit(microread_mei_exit);
+module_mei_cl_driver(microread_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION(DRIVER_DESC);
index 46d0eb24eef9e07878443a38af17ab10e27ed341..ad57a8ec00d654224d2be29ed65669d938b5c0b4 100644 (file)
@@ -82,28 +82,7 @@ static struct mei_cl_driver pn544_driver = {
        .remove = pn544_mei_remove,
 };
 
-static int pn544_mei_init(void)
-{
-       int r;
-
-       pr_debug(DRIVER_DESC ": %s\n", __func__);
-
-       r = mei_cldev_driver_register(&pn544_driver);
-       if (r) {
-               pr_err(PN544_DRIVER_NAME ": driver registration failed\n");
-               return r;
-       }
-
-       return 0;
-}
-
-static void pn544_mei_exit(void)
-{
-       mei_cldev_driver_unregister(&pn544_driver);
-}
-
-module_init(pn544_mei_init);
-module_exit(pn544_mei_exit);
+module_mei_cl_driver(pn544_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION(DRIVER_DESC);