* [PATCH -next] PCI/IOV: use module_pci_driver to simplify the code
@ 2020-09-17 7:10 Liu Shixin
2020-09-17 16:51 ` Bjorn Helgaas
0 siblings, 1 reply; 4+ messages in thread
From: Liu Shixin @ 2020-09-17 7:10 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: linux-pci, linux-kernel, Liu Shixin
Use the module_pci_driver() macro to make the code simpler
by eliminating module_init and module_exit calls.
Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
drivers/pci/pci-pf-stub.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/drivers/pci/pci-pf-stub.c b/drivers/pci/pci-pf-stub.c
index a0b2bd6c918a..45855a5e9fca 100644
--- a/drivers/pci/pci-pf-stub.c
+++ b/drivers/pci/pci-pf-stub.c
@@ -37,18 +37,6 @@ static struct pci_driver pf_stub_driver = {
.probe = pci_pf_stub_probe,
.sriov_configure = pci_sriov_configure_simple,
};
-
-static int __init pci_pf_stub_init(void)
-{
- return pci_register_driver(&pf_stub_driver);
-}
-
-static void __exit pci_pf_stub_exit(void)
-{
- pci_unregister_driver(&pf_stub_driver);
-}
-
-module_init(pci_pf_stub_init);
-module_exit(pci_pf_stub_exit);
+module_pci_driver(pf_stub_driver);
MODULE_LICENSE("GPL");
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH -next] PCI/IOV: use module_pci_driver to simplify the code
2020-09-17 7:10 [PATCH -next] PCI/IOV: use module_pci_driver to simplify the code Liu Shixin
@ 2020-09-17 16:51 ` Bjorn Helgaas
2020-09-17 17:19 ` Alexander Duyck
0 siblings, 1 reply; 4+ messages in thread
From: Bjorn Helgaas @ 2020-09-17 16:51 UTC (permalink / raw)
To: Liu Shixin; +Cc: Bjorn Helgaas, linux-pci, linux-kernel, Alexander Duyck
[+cc Alexander]
On Thu, Sep 17, 2020 at 03:10:42PM +0800, Liu Shixin wrote:
> Use the module_pci_driver() macro to make the code simpler
> by eliminating module_init and module_exit calls.
>
> Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Applied to pci/misc for v5.10, thanks!
> ---
> drivers/pci/pci-pf-stub.c | 14 +-------------
> 1 file changed, 1 insertion(+), 13 deletions(-)
>
> diff --git a/drivers/pci/pci-pf-stub.c b/drivers/pci/pci-pf-stub.c
> index a0b2bd6c918a..45855a5e9fca 100644
> --- a/drivers/pci/pci-pf-stub.c
> +++ b/drivers/pci/pci-pf-stub.c
> @@ -37,18 +37,6 @@ static struct pci_driver pf_stub_driver = {
> .probe = pci_pf_stub_probe,
> .sriov_configure = pci_sriov_configure_simple,
> };
> -
> -static int __init pci_pf_stub_init(void)
> -{
> - return pci_register_driver(&pf_stub_driver);
> -}
> -
> -static void __exit pci_pf_stub_exit(void)
> -{
> - pci_unregister_driver(&pf_stub_driver);
> -}
> -
> -module_init(pci_pf_stub_init);
> -module_exit(pci_pf_stub_exit);
> +module_pci_driver(pf_stub_driver);
>
> MODULE_LICENSE("GPL");
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] PCI/IOV: use module_pci_driver to simplify the code
2020-09-17 16:51 ` Bjorn Helgaas
@ 2020-09-17 17:19 ` Alexander Duyck
2020-09-17 17:42 ` Bjorn Helgaas
0 siblings, 1 reply; 4+ messages in thread
From: Alexander Duyck @ 2020-09-17 17:19 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: Liu Shixin, Bjorn Helgaas, linux-pci, LKML, Alexander Duyck
On Thu, Sep 17, 2020 at 9:56 AM Bjorn Helgaas <helgaas@kernel.org> wrote:
>
> [+cc Alexander]
>
> On Thu, Sep 17, 2020 at 03:10:42PM +0800, Liu Shixin wrote:
> > Use the module_pci_driver() macro to make the code simpler
> > by eliminating module_init and module_exit calls.
> >
> > Signed-off-by: Liu Shixin <liushixin2@huawei.com>
>
> Applied to pci/misc for v5.10, thanks!
The code below seems pretty straight forward.
Acked-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
> > ---
> > drivers/pci/pci-pf-stub.c | 14 +-------------
> > 1 file changed, 1 insertion(+), 13 deletions(-)
> >
> > diff --git a/drivers/pci/pci-pf-stub.c b/drivers/pci/pci-pf-stub.c
> > index a0b2bd6c918a..45855a5e9fca 100644
> > --- a/drivers/pci/pci-pf-stub.c
> > +++ b/drivers/pci/pci-pf-stub.c
> > @@ -37,18 +37,6 @@ static struct pci_driver pf_stub_driver = {
> > .probe = pci_pf_stub_probe,
> > .sriov_configure = pci_sriov_configure_simple,
> > };
> > -
> > -static int __init pci_pf_stub_init(void)
> > -{
> > - return pci_register_driver(&pf_stub_driver);
> > -}
> > -
> > -static void __exit pci_pf_stub_exit(void)
> > -{
> > - pci_unregister_driver(&pf_stub_driver);
> > -}
> > -
> > -module_init(pci_pf_stub_init);
> > -module_exit(pci_pf_stub_exit);
> > +module_pci_driver(pf_stub_driver);
> >
> > MODULE_LICENSE("GPL");
> > --
> > 2.25.1
> >
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] PCI/IOV: use module_pci_driver to simplify the code
2020-09-17 17:19 ` Alexander Duyck
@ 2020-09-17 17:42 ` Bjorn Helgaas
0 siblings, 0 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2020-09-17 17:42 UTC (permalink / raw)
To: Alexander Duyck
Cc: Liu Shixin, Bjorn Helgaas, linux-pci, LKML, Alexander Duyck
On Thu, Sep 17, 2020 at 10:19:13AM -0700, Alexander Duyck wrote:
> On Thu, Sep 17, 2020 at 9:56 AM Bjorn Helgaas <helgaas@kernel.org> wrote:
> >
> > [+cc Alexander]
> >
> > On Thu, Sep 17, 2020 at 03:10:42PM +0800, Liu Shixin wrote:
> > > Use the module_pci_driver() macro to make the code simpler
> > > by eliminating module_init and module_exit calls.
> > >
> > > Signed-off-by: Liu Shixin <liushixin2@huawei.com>
> >
> > Applied to pci/misc for v5.10, thanks!
>
> The code below seems pretty straight forward.
>
> Acked-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Thanks a lot for taking a look, Alexander, I added your ack.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-09-17 17:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17 7:10 [PATCH -next] PCI/IOV: use module_pci_driver to simplify the code Liu Shixin
2020-09-17 16:51 ` Bjorn Helgaas
2020-09-17 17:19 ` Alexander Duyck
2020-09-17 17:42 ` Bjorn Helgaas
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.