diff mbox series

[net-next] net: ethernet: 8390: ne2k-pci: use module_pci_driver() macro

Message ID 20230810014633.3084355-1-yangyingliang@huawei.com (mailing list archive)
State Accepted
Commit 5604ac35cb6ec34ad608008ba851568c385fd3f4
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: ethernet: 8390: ne2k-pci: use module_pci_driver() macro | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1332 this patch: 1332
netdev/cc_maintainers warning 1 maintainers not CCed: bagasdotme@gmail.com
netdev/build_clang success Errors and warnings before: 1353 this patch: 1353
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1355 this patch: 1355
netdev/checkpatch warning WARNING: drivers/net/ethernet/8390/ne2k-pci.c is marked as 'obsolete' in the MAINTAINERS hierarchy. No unnecessary modifications please.
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Yang Yingliang Aug. 10, 2023, 1:46 a.m. UTC
The driver init/exit() function don't do anything special, it
can use the module_pci_driver() macro to eliminate boilerplate
code.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/net/ethernet/8390/ne2k-pci.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

Comments

Pavan Chebbi Aug. 10, 2023, 8:33 a.m. UTC | #1
On Thu, Aug 10, 2023 at 7:19 AM Yang Yingliang <yangyingliang@huawei.com> wrote:
>
> The driver init/exit() function don't do anything special, it
> can use the module_pci_driver() macro to eliminate boilerplate
> code.
>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  drivers/net/ethernet/8390/ne2k-pci.c | 16 +---------------
>  1 file changed, 1 insertion(+), 15 deletions(-)
>
> diff --git a/drivers/net/ethernet/8390/ne2k-pci.c b/drivers/net/ethernet/8390/ne2k-pci.c
> index 2c6bd36d2f31..65f56a98c0a0 100644
> --- a/drivers/net/ethernet/8390/ne2k-pci.c
> +++ b/drivers/net/ethernet/8390/ne2k-pci.c
> @@ -731,18 +731,4 @@ static struct pci_driver ne2k_driver = {
>         .id_table       = ne2k_pci_tbl,
>         .driver.pm      = &ne2k_pci_pm_ops,
>  };
> -
> -
> -static int __init ne2k_pci_init(void)
> -{
> -       return pci_register_driver(&ne2k_driver);
> -}
> -
> -
> -static void __exit ne2k_pci_cleanup(void)
> -{
> -       pci_unregister_driver(&ne2k_driver);
> -}
> -
> -module_init(ne2k_pci_init);
> -module_exit(ne2k_pci_cleanup);
> +module_pci_driver(ne2k_driver);
> --
> 2.25.1
>
>

LGTM.
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
patchwork-bot+netdevbpf@kernel.org Aug. 11, 2023, 2:40 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 10 Aug 2023 09:46:33 +0800 you wrote:
> The driver init/exit() function don't do anything special, it
> can use the module_pci_driver() macro to eliminate boilerplate
> code.
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  drivers/net/ethernet/8390/ne2k-pci.c | 16 +---------------
>  1 file changed, 1 insertion(+), 15 deletions(-)

Here is the summary with links:
  - [net-next] net: ethernet: 8390: ne2k-pci: use module_pci_driver() macro
    https://git.kernel.org/netdev/net-next/c/5604ac35cb6e

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/8390/ne2k-pci.c b/drivers/net/ethernet/8390/ne2k-pci.c
index 2c6bd36d2f31..65f56a98c0a0 100644
--- a/drivers/net/ethernet/8390/ne2k-pci.c
+++ b/drivers/net/ethernet/8390/ne2k-pci.c
@@ -731,18 +731,4 @@  static struct pci_driver ne2k_driver = {
 	.id_table	= ne2k_pci_tbl,
 	.driver.pm	= &ne2k_pci_pm_ops,
 };
-
-
-static int __init ne2k_pci_init(void)
-{
-	return pci_register_driver(&ne2k_driver);
-}
-
-
-static void __exit ne2k_pci_cleanup(void)
-{
-	pci_unregister_driver(&ne2k_driver);
-}
-
-module_init(ne2k_pci_init);
-module_exit(ne2k_pci_cleanup);
+module_pci_driver(ne2k_driver);