drm/hisilicon/hibmc: Using module_pci_driver.
authorYueHaibing <yuehaibing@huawei.com>
Sat, 21 Apr 2018 09:51:48 +0000 (17:51 +0800)
committerXinliang Liu <z.liuxinliang@hisilicon.com>
Mon, 26 Aug 2019 07:21:33 +0000 (15:21 +0800)
Remove boilerplate code by using macro module_pci_driver.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Xinliang Liu <z.liuxinliang@hisilicon.com>
Signed-off-by: Xinliang Liu <z.liuxinliang@hisilicon.com>
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c

index 2ae5388357814faf11fcc9d0696dea595b4034c3..5a9fa8783a4dc2ae7bcb74cf9a1c05c501c5461c 100644 (file)
@@ -394,18 +394,7 @@ static struct pci_driver hibmc_pci_driver = {
        .driver.pm =    &hibmc_pm_ops,
 };
 
-static int __init hibmc_init(void)
-{
-       return pci_register_driver(&hibmc_pci_driver);
-}
-
-static void __exit hibmc_exit(void)
-{
-       return pci_unregister_driver(&hibmc_pci_driver);
-}
-
-module_init(hibmc_init);
-module_exit(hibmc_exit);
+module_pci_driver(hibmc_pci_driver);
 
 MODULE_DEVICE_TABLE(pci, hibmc_pci_table);
 MODULE_AUTHOR("RongrongZou <zourongrong@huawei.com>");