Print this page
fixup .text where possible
7127 remove -Wno-missing-braces from Makefile.uts
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/io/1394/s1394.c
+++ new/usr/src/uts/common/io/1394/s1394.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 23 * Copyright (c) 1999-2000 by Sun Microsystems, Inc.
24 24 * All rights reserved.
25 25 */
26 26
27 -#pragma ident "%Z%%M% %I% %E% SMI"
28 27
28 +
29 29 /*
30 30 * s1394.c
31 31 * 1394 Services Layer Initialization and Cleanup Routines
32 32 * The routines do all initialization and cleanup for the Sevices Layer
33 33 */
34 34
35 35 #include <sys/conf.h>
36 36 #include <sys/ddi.h>
37 37 #include <sys/sunddi.h>
38 38 #include <sys/types.h>
39 39 #include <sys/kmem.h>
40 40 #include <sys/tnf_probe.h>
41 41
42 42 #include <sys/1394/t1394.h>
43 43 #include <sys/1394/s1394.h>
44 44 #include <sys/1394/h1394.h>
45 45
46 46 /* Driver State Pointer */
47 47 s1394_state_t *s1394_statep;
↓ open down ↓ |
9 lines elided |
↑ open up ↑ |
48 48
49 49 /* Module Driver Info */
50 50 static struct modlmisc s1394_modlmisc = {
51 51 &mod_miscops,
52 52 "IEEE 1394 Services Library 1.0"
53 53 };
54 54
55 55 /* Module Linkage */
56 56 static struct modlinkage s1394_modlinkage = {
57 57 MODREV_1,
58 - &s1394_modlmisc,
59 - NULL
58 + { &s1394_modlmisc,
59 + NULL }
60 60 };
61 61
62 62 static int s1394_init();
63 63 static void s1394_fini();
64 64
65 65 #ifndef NPROBE
66 66 extern int tnf_mod_load(void);
67 67 extern int tnf_mod_unload(struct modlinkage *mlp);
68 68 #endif
69 69
70 70 int
71 71 _init()
72 72 {
73 73 int status;
74 74
75 75 #ifndef NPROBE
76 76 (void) tnf_mod_load();
77 77 #endif
78 78 status = s1394_init();
79 79 if (status != 0) {
80 80 TNF_PROBE_1(_init_error, S1394_TNF_SL_ERROR, "",
81 81 tnf_string, msg, "s1394: failed in s1394_init");
82 82 #ifndef NPROBE
83 83 (void) tnf_mod_unload(&s1394_modlinkage);
84 84 #endif
85 85 return (status);
86 86 }
87 87
88 88 status = mod_install(&s1394_modlinkage);
89 89 if (status != 0) {
90 90 TNF_PROBE_1(_init_error, S1394_TNF_SL_ERROR, "",
91 91 tnf_string, msg, "s1394: failed in mod_install");
92 92 #ifndef NPROBE
93 93 (void) tnf_mod_unload(&s1394_modlinkage);
94 94 #endif
95 95 }
96 96 return (status);
97 97 }
98 98
99 99 int
100 100 _info(struct modinfo *modinfop)
101 101 {
102 102 return (mod_info(&s1394_modlinkage, modinfop));
103 103 }
104 104
105 105 int
106 106 _fini()
107 107 {
108 108 int status;
109 109
110 110 status = mod_remove(&s1394_modlinkage);
111 111 if (status != 0) {
112 112 TNF_PROBE_1(_fini_error, S1394_TNF_SL_ERROR, "",
113 113 tnf_string, msg, "s1394: failed in mod_remove");
114 114 return (status);
115 115 }
116 116
117 117 s1394_fini();
118 118 #ifndef NPROBE
119 119 (void) tnf_mod_unload(&s1394_modlinkage);
120 120 #endif
121 121 return (status);
122 122 }
123 123
124 124 /*
125 125 * s1394_init()
126 126 * initializes the 1394 Software Framework's structures, i.e. the HAL list
127 127 * and associated mutex.
128 128 */
129 129 static int
130 130 s1394_init()
131 131 {
132 132 TNF_PROBE_0_DEBUG(s1394_init_enter, S1394_TNF_SL_STACK, "");
133 133
134 134 s1394_statep = kmem_zalloc(sizeof (s1394_state_t), KM_SLEEP);
135 135
136 136 s1394_statep->hal_head = NULL;
137 137 s1394_statep->hal_tail = NULL;
138 138 mutex_init(&s1394_statep->hal_list_mutex, NULL, MUTEX_DRIVER, NULL);
139 139
140 140 TNF_PROBE_0_DEBUG(s1394_init_exit, S1394_TNF_SL_STACK, "");
141 141 return (0);
142 142 }
143 143
144 144 /*
145 145 * s1394_fini()
146 146 * cleans up the 1394 Software Framework's structures that were allocated
147 147 * in s1394_init().
148 148 */
149 149 static void
150 150 s1394_fini()
151 151 {
152 152 TNF_PROBE_0_DEBUG(s1394_fini_enter, S1394_TNF_SL_STACK, "");
153 153
154 154 mutex_destroy(&s1394_statep->hal_list_mutex);
155 155
156 156 kmem_free(s1394_statep, sizeof (s1394_state_t));
157 157
158 158 TNF_PROBE_0_DEBUG(s1394_fini_exit, S1394_TNF_SL_STACK, "");
159 159 }
↓ open down ↓ |
90 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX