PNP: tpm/tpm_infineon: Use module_pnp_driver to register driver
authorPeter Huewe <PeterHuewe@gmx.de>
Mon, 16 Mar 2015 20:46:31 +0000 (21:46 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 18 Mar 2015 21:39:17 +0000 (22:39 +0100)
Removing some boilerplate by using module_pnp_driver instead of calling
register and unregister in the otherwise empty init/exit functions

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/char/tpm/tpm_infineon.c

index 6d492132ad2b755da40d11d7ff99e5cff8a56bcb..29ba520ac24d2fb60cd8d2e788774fc69bdd40c2 100644 (file)
@@ -637,18 +637,7 @@ static struct pnp_driver tpm_inf_pnp_driver = {
        .remove = tpm_inf_pnp_remove
 };
 
-static int __init init_inf(void)
-{
-       return pnp_register_driver(&tpm_inf_pnp_driver);
-}
-
-static void __exit cleanup_inf(void)
-{
-       pnp_unregister_driver(&tpm_inf_pnp_driver);
-}
-
-module_init(init_inf);
-module_exit(cleanup_inf);
+module_pnp_driver(tpm_inf_pnp_driver);
 
 MODULE_AUTHOR("Marcel Selhorst <tpmdd@sirrix.com>");
 MODULE_DESCRIPTION("Driver for Infineon TPM SLD 9630 TT 1.1 / SLB 9635 TT 1.2");