* [PATCH] i2c: i801: simplify module boilerplate code
@ 2023-09-18 12:16 Heiner Kallweit
2023-09-19 15:51 ` Jean Delvare
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Heiner Kallweit @ 2023-09-18 12:16 UTC (permalink / raw)
To: Jean Delvare, Andi Shyti; +Cc: linux-i2c
Simplify the module boilerplate code.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/i2c/busses/i2c-i801.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 811541797..6d02a8b88 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -1847,16 +1847,11 @@ static struct pci_driver i801_driver = {
},
};
-static int __init i2c_i801_init(void)
+static int __init i2c_i801_init(struct pci_driver *drv)
{
if (dmi_name_in_vendors("FUJITSU"))
input_apanel_init();
- return pci_register_driver(&i801_driver);
-}
-
-static void __exit i2c_i801_exit(void)
-{
- pci_unregister_driver(&i801_driver);
+ return pci_register_driver(drv);
}
MODULE_AUTHOR("Mark D. Studebaker <mdsxyz123@yahoo.com>");
@@ -1864,5 +1859,4 @@ MODULE_AUTHOR("Jean Delvare <jdelvare@suse.de>");
MODULE_DESCRIPTION("I801 SMBus driver");
MODULE_LICENSE("GPL");
-module_init(i2c_i801_init);
-module_exit(i2c_i801_exit);
+module_driver(i801_driver, i2c_i801_init, pci_unregister_driver);
--
2.42.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] i2c: i801: simplify module boilerplate code
2023-09-18 12:16 [PATCH] i2c: i801: simplify module boilerplate code Heiner Kallweit
@ 2023-09-19 15:51 ` Jean Delvare
2023-09-19 16:24 ` Andi Shyti
2023-09-19 19:53 ` Wolfram Sang
2 siblings, 0 replies; 4+ messages in thread
From: Jean Delvare @ 2023-09-19 15:51 UTC (permalink / raw)
To: Heiner Kallweit; +Cc: Andi Shyti, linux-i2c
On Mon, 18 Sep 2023 14:16:58 +0200, Heiner Kallweit wrote:
> Simplify the module boilerplate code.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
> drivers/i2c/busses/i2c-i801.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
> index 811541797..6d02a8b88 100644
> --- a/drivers/i2c/busses/i2c-i801.c
> +++ b/drivers/i2c/busses/i2c-i801.c
> @@ -1847,16 +1847,11 @@ static struct pci_driver i801_driver = {
> },
> };
>
> -static int __init i2c_i801_init(void)
> +static int __init i2c_i801_init(struct pci_driver *drv)
> {
> if (dmi_name_in_vendors("FUJITSU"))
> input_apanel_init();
> - return pci_register_driver(&i801_driver);
> -}
> -
> -static void __exit i2c_i801_exit(void)
> -{
> - pci_unregister_driver(&i801_driver);
> + return pci_register_driver(drv);
> }
>
> MODULE_AUTHOR("Mark D. Studebaker <mdsxyz123@yahoo.com>");
> @@ -1864,5 +1859,4 @@ MODULE_AUTHOR("Jean Delvare <jdelvare@suse.de>");
> MODULE_DESCRIPTION("I801 SMBus driver");
> MODULE_LICENSE("GPL");
>
> -module_init(i2c_i801_init);
> -module_exit(i2c_i801_exit);
> +module_driver(i801_driver, i2c_i801_init, pci_unregister_driver);
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Thanks,
--
Jean Delvare
SUSE L3 Support
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] i2c: i801: simplify module boilerplate code
2023-09-18 12:16 [PATCH] i2c: i801: simplify module boilerplate code Heiner Kallweit
2023-09-19 15:51 ` Jean Delvare
@ 2023-09-19 16:24 ` Andi Shyti
2023-09-19 19:53 ` Wolfram Sang
2 siblings, 0 replies; 4+ messages in thread
From: Andi Shyti @ 2023-09-19 16:24 UTC (permalink / raw)
To: Heiner Kallweit; +Cc: Jean Delvare, linux-i2c
Hi Heiner,
On Mon, Sep 18, 2023 at 02:16:58PM +0200, Heiner Kallweit wrote:
> Simplify the module boilerplate code.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Acked-by: Andi Shyti <andi.shyti@kernel.org>
Thanks,
Andi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] i2c: i801: simplify module boilerplate code
2023-09-18 12:16 [PATCH] i2c: i801: simplify module boilerplate code Heiner Kallweit
2023-09-19 15:51 ` Jean Delvare
2023-09-19 16:24 ` Andi Shyti
@ 2023-09-19 19:53 ` Wolfram Sang
2 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2023-09-19 19:53 UTC (permalink / raw)
To: Heiner Kallweit; +Cc: Jean Delvare, Andi Shyti, linux-i2c
[-- Attachment #1: Type: text/plain, Size: 202 bytes --]
On Mon, Sep 18, 2023 at 02:16:58PM +0200, Heiner Kallweit wrote:
> Simplify the module boilerplate code.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Applied to for-next, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-09-19 19:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-18 12:16 [PATCH] i2c: i801: simplify module boilerplate code Heiner Kallweit
2023-09-19 15:51 ` Jean Delvare
2023-09-19 16:24 ` Andi Shyti
2023-09-19 19:53 ` Wolfram Sang
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.