Linux 4.18.10
[linux/fpc-iii.git] / drivers / w1 / slaves / w1_smem.c
blobe556b0caff7191245c6627ba36240713fca550b8
1 /*
2 * w1_smem.c
4 * Copyright (c) 2004 Evgeniy Polyakov <zbr@ioremap.net>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the smems of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include <asm/types.h>
24 #include <linux/kernel.h>
25 #include <linux/module.h>
26 #include <linux/moduleparam.h>
27 #include <linux/device.h>
28 #include <linux/types.h>
30 #include <linux/w1.h>
32 #define W1_FAMILY_SMEM_01 0x01
33 #define W1_FAMILY_SMEM_81 0x81
35 static struct w1_family w1_smem_family_01 = {
36 .fid = W1_FAMILY_SMEM_01,
39 static struct w1_family w1_smem_family_81 = {
40 .fid = W1_FAMILY_SMEM_81,
43 static int __init w1_smem_init(void)
45 int err;
47 err = w1_register_family(&w1_smem_family_01);
48 if (err)
49 return err;
51 err = w1_register_family(&w1_smem_family_81);
52 if (err) {
53 w1_unregister_family(&w1_smem_family_01);
54 return err;
57 return 0;
60 static void __exit w1_smem_fini(void)
62 w1_unregister_family(&w1_smem_family_01);
63 w1_unregister_family(&w1_smem_family_81);
66 module_init(w1_smem_init);
67 module_exit(w1_smem_fini);
69 MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>");
70 MODULE_DESCRIPTION("Driver for 1-wire Dallas network protocol, 64bit memory family.");
71 MODULE_LICENSE("GPL");
72 MODULE_ALIAS("w1-family-" __stringify(W1_FAMILY_SMEM_01));
73 MODULE_ALIAS("w1-family-" __stringify(W1_FAMILY_SMEM_81));