diff mbox

[-next] HID: intel-ish-hid: use module_pci_driver to simplify the code

Message ID 1471793316-23880-1-git-send-email-weiyj.lk@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Yongjun Aug. 21, 2016, 3:28 p.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

Use the module_pci_driver() macro to make the code simpler
by eliminating module_init and module_exit calls.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/hid/intel-ish-hid/ipc/pci-ish.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)




--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Srinivas Pandruvada Aug. 26, 2016, 7 p.m. UTC | #1
On Sun, 2016-08-21 at 15:28 +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Use the module_pci_driver() macro to make the code simpler
> by eliminating module_init and module_exit calls.
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

> ---
>  drivers/hid/intel-ish-hid/ipc/pci-ish.c | 13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/drivers/hid/intel-ish-hid/ipc/pci-ish.c
> b/drivers/hid/intel-ish-hid/ipc/pci-ish.c
> index b14d6f4..42f0bee 100644
> --- a/drivers/hid/intel-ish-hid/ipc/pci-ish.c
> +++ b/drivers/hid/intel-ish-hid/ipc/pci-ish.c
> @@ -311,18 +311,7 @@ static struct pci_driver ish_driver = {
>  	.driver.pm = ISHTP_ISH_PM_OPS,
>  };
>  
> -static int __init ish_driver_init(void)
> -{
> -	return pci_register_driver(&ish_driver);
> -}
> -
> -static void __exit ish_driver_exit(void)
> -{
> -	pci_unregister_driver(&ish_driver);
> -}
> -
> -module_init(ish_driver_init);
> -module_exit(ish_driver_exit);
> +module_pci_driver(ish_driver);
>  
>  /* Original author */
>  MODULE_AUTHOR("Daniel Drubin <daniel.drubin@intel.com>");
> 
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/hid/intel-ish-hid/ipc/pci-ish.c b/drivers/hid/intel-ish-hid/ipc/pci-ish.c
index b14d6f4..42f0bee 100644
--- a/drivers/hid/intel-ish-hid/ipc/pci-ish.c
+++ b/drivers/hid/intel-ish-hid/ipc/pci-ish.c
@@ -311,18 +311,7 @@  static struct pci_driver ish_driver = {
 	.driver.pm = ISHTP_ISH_PM_OPS,
 };
 
-static int __init ish_driver_init(void)
-{
-	return pci_register_driver(&ish_driver);
-}
-
-static void __exit ish_driver_exit(void)
-{
-	pci_unregister_driver(&ish_driver);
-}
-
-module_init(ish_driver_init);
-module_exit(ish_driver_exit);
+module_pci_driver(ish_driver);
 
 /* Original author */
 MODULE_AUTHOR("Daniel Drubin <daniel.drubin@intel.com>");