drm/hisilicon/hibmc: Using module_pci_driver.

Submitted by YueHaibing on April 21, 2018, 9:51 a.m.

Details

Message ID 20180421095148.17840-1-yuehaibing@huawei.com
State New
Headers show
Series "drm/hisilicon/hibmc: Using module_pci_driver." ( rev: 1 ) in DRI devel

Not browsing as part of any series.

Commit Message

YueHaibing April 21, 2018, 9:51 a.m.
Remove boilerplate code by using macro module_pci_driver.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
index d4f6f1f..68d80c1 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
@@ -414,18 +414,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>");

Comments

On 2018/4/21 17:51, YueHaibing wrote:
> Remove boilerplate code by using macro module_pci_driver.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Thanks Haibing,

Reviewed-by: Xinliang Liu <z.liuxinliang@hisilicon.com>

Xinliang

> ---
>   drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 13 +------------
>   1 file changed, 1 insertion(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> index d4f6f1f..68d80c1 100644
> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> @@ -414,18 +414,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>");