All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next 1/2] w1: ds2805: Use module_w1_family to simplify the code
@ 2021-04-08 13:09 Chen Huang
  2021-04-08 13:09 ` [PATCH -next 2/2] w1: ds28e17: " Chen Huang
  0 siblings, 1 reply; 2+ messages in thread
From: Chen Huang @ 2021-04-08 13:09 UTC (permalink / raw)
  To: Evgeniy Polyakov, Rikard Falkeborn, Greg Kroah-Hartman
  Cc: linux-kernel, kernel-janitors, Chen Huang

module_w1_family() makes the code simpler by eliminating
boilerplate code.

Signed-off-by: Chen Huang <chenhuang5@huawei.com>
---
 drivers/w1/slaves/w1_ds2805.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/w1/slaves/w1_ds2805.c b/drivers/w1/slaves/w1_ds2805.c
index 206186db727d..6b5d12ba1b65 100644
--- a/drivers/w1/slaves/w1_ds2805.c
+++ b/drivers/w1/slaves/w1_ds2805.c
@@ -291,20 +291,7 @@ static struct w1_family w1_family_0d = {
 	.fops = &w1_f0d_fops,
 };
 
-static int __init w1_f0d_init(void)
-{
-	pr_info("%s()\n", __func__);
-	return w1_register_family(&w1_family_0d);
-}
-
-static void __exit w1_f0d_fini(void)
-{
-	pr_info("%s()\n", __func__);
-	w1_unregister_family(&w1_family_0d);
-}
-
-module_init(w1_f0d_init);
-module_exit(w1_f0d_fini);
+module_w1_family(w1_family_0d);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Andrew Worsley amworsley@gmail.com");
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH -next 2/2] w1: ds28e17: Use module_w1_family to simplify the code
  2021-04-08 13:09 [PATCH -next 1/2] w1: ds2805: Use module_w1_family to simplify the code Chen Huang
@ 2021-04-08 13:09 ` Chen Huang
  0 siblings, 0 replies; 2+ messages in thread
From: Chen Huang @ 2021-04-08 13:09 UTC (permalink / raw)
  To: Evgeniy Polyakov, Rikard Falkeborn, Greg Kroah-Hartman
  Cc: linux-kernel, kernel-janitors, Chen Huang

module_w1_family() makes the code simpler by eliminating
boilerplate code.

Signed-off-by: Chen Huang <chenhuang5@huawei.com>
---
 drivers/w1/slaves/w1_ds28e17.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/drivers/w1/slaves/w1_ds28e17.c b/drivers/w1/slaves/w1_ds28e17.c
index 6b00db7169ab..aed10b72fc99 100644
--- a/drivers/w1/slaves/w1_ds28e17.c
+++ b/drivers/w1/slaves/w1_ds28e17.c
@@ -752,18 +752,4 @@ static struct w1_family w1_family_19 = {
 	.fops = &w1_f19_fops,
 };
 
-
-/* Module init and remove functions. */
-static int __init w1_f19_init(void)
-{
-	return w1_register_family(&w1_family_19);
-}
-
-static void __exit w1_f19_fini(void)
-{
-	w1_unregister_family(&w1_family_19);
-}
-
-module_init(w1_f19_init);
-module_exit(w1_f19_fini);
-
+module_w1_family(w1_family_19);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-08 13:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-08 13:09 [PATCH -next 1/2] w1: ds2805: Use module_w1_family to simplify the code Chen Huang
2021-04-08 13:09 ` [PATCH -next 2/2] w1: ds28e17: " Chen Huang

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.