Commit | Line | Data |
---|---|---|
1da177e4 | 1 | /* |
7785925d | 2 | * w1_smem.c |
1da177e4 | 3 | * |
a8018766 | 4 | * Copyright (c) 2004 Evgeniy Polyakov <zbr@ioremap.net> |
7785925d | 5 | * |
1da177e4 LT |
6 | * |
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. | |
11 | * | |
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. | |
16 | * | |
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 | |
20 | */ | |
21 | ||
22 | #include <asm/types.h> | |
23 | ||
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> | |
29 | ||
bd529cfb | 30 | #include "../w1.h" |
bd529cfb EP |
31 | #include "../w1_int.h" |
32 | #include "../w1_family.h" | |
1da177e4 LT |
33 | |
34 | MODULE_LICENSE("GPL"); | |
a8018766 | 35 | MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>"); |
1da177e4 | 36 | MODULE_DESCRIPTION("Driver for 1-wire Dallas network protocol, 64bit memory family."); |
8d7bda51 AS |
37 | MODULE_ALIAS("w1-family-" __stringify(W1_FAMILY_SMEM_01)); |
38 | MODULE_ALIAS("w1-family-" __stringify(W1_FAMILY_SMEM_81)); | |
1da177e4 | 39 | |
85e941cc EP |
40 | static struct w1_family w1_smem_family_01 = { |
41 | .fid = W1_FAMILY_SMEM_01, | |
85e941cc EP |
42 | }; |
43 | ||
44 | static struct w1_family w1_smem_family_81 = { | |
45 | .fid = W1_FAMILY_SMEM_81, | |
1da177e4 LT |
46 | }; |
47 | ||
48 | static int __init w1_smem_init(void) | |
49 | { | |
85e941cc EP |
50 | int err; |
51 | ||
52 | err = w1_register_family(&w1_smem_family_01); | |
53 | if (err) | |
54 | return err; | |
bd529cfb | 55 | |
85e941cc EP |
56 | err = w1_register_family(&w1_smem_family_81); |
57 | if (err) { | |
58 | w1_unregister_family(&w1_smem_family_01); | |
59 | return err; | |
60 | } | |
61 | ||
62 | return 0; | |
1da177e4 LT |
63 | } |
64 | ||
65 | static void __exit w1_smem_fini(void) | |
66 | { | |
85e941cc EP |
67 | w1_unregister_family(&w1_smem_family_01); |
68 | w1_unregister_family(&w1_smem_family_81); | |
1da177e4 LT |
69 | } |
70 | ||
71 | module_init(w1_smem_init); | |
72 | module_exit(w1_smem_fini); |