[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231117192909.98944-2-marc.ferland@sonatest.com>
Date: Fri, 17 Nov 2023 14:29:04 -0500
From: marc.ferland@...il.com
To: krzysztof.kozlowski@...aro.org
Cc: gregkh@...uxfoundation.org, marc.ferland@...atest.com,
jeff.dagenais@...il.com, rdunlap@...radead.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/7] w1: ds2433: add support for registering multiple families
From: Jean-Francois Dagenais <jeff.dagenais@...il.com>
This is ground work for supporting both the ds2433 and the
ds28ec20. Inspired by the w1_ds250x driver.
Signed-off-by: Marc Ferland <marc.ferland@...atest.com>
Signed-off-by: Jean-Francois Dagenais <jeff.dagenais@...il.com>
---
drivers/w1/slaves/w1_ds2433.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/drivers/w1/slaves/w1_ds2433.c b/drivers/w1/slaves/w1_ds2433.c
index e18523ef8c45..e1e45ea1bfa4 100644
--- a/drivers/w1/slaves/w1_ds2433.c
+++ b/drivers/w1/slaves/w1_ds2433.c
@@ -299,7 +299,25 @@ static struct w1_family w1_family_23 = {
.fid = W1_EEPROM_DS2433,
.fops = &w1_f23_fops,
};
-module_w1_family(w1_family_23);
+
+static int __init w1_ds2433_init(void)
+{
+ int err;
+
+ err = w1_register_family(&w1_family_23);
+ if (err)
+ return err;
+
+ return 0;
+}
+
+static void __exit w1_ds2433_exit(void)
+{
+ w1_unregister_family(&w1_family_23);
+}
+
+module_init(w1_ds2433_init);
+module_exit(w1_ds2433_exit);
MODULE_AUTHOR("Ben Gardner <bgardner@...tec.com>");
MODULE_DESCRIPTION("w1 family 23 driver for DS2433, 4kb EEPROM");
--
2.34.1
Powered by blists - more mailing lists