w1: ds2405: use module_w1_family to simplify the code
authorWei Yongjun <weiyongjun1@huawei.com>
Thu, 9 Feb 2017 15:45:19 +0000 (15:45 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Feb 2017 14:32:53 +0000 (15:32 +0100)
module_w1_family() makes the code simpler by eliminating
boilerplate code.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/w1/slaves/w1_ds2405.c

index 1f350cf2b6ec7d1e705a2d1761dd2733581e3148..d5d54876cb64a2cba90ffb39917ad29852b6278f 100644 (file)
@@ -224,15 +224,4 @@ static struct w1_family w1_family_ds2405 = {
        .fops = &w1_ds2405_fops
 };
 
-static int __init w1_ds2405_init(void)
-{
-       return w1_register_family(&w1_family_ds2405);
-}
-
-static void __exit w1_ds2405_fini(void)
-{
-       w1_unregister_family(&w1_family_ds2405);
-}
-
-module_init(w1_ds2405_init);
-module_exit(w1_ds2405_fini);
+module_w1_family(w1_family_ds2405);