Print this page
7127 remove -Wno-missing-braces from Makefile.uts
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/io/options.c
+++ new/usr/src/uts/common/io/options.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 (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26
27 27
28 28 #include <sys/types.h>
29 29 #include <sys/errno.h>
30 30 #include <sys/conf.h>
31 31 #include <sys/ddi.h>
32 32 #include <sys/sunddi.h>
33 33
34 34 /*
35 35 * Configuration information
36 36 */
37 37
38 38 static int options_info(dev_info_t *dip, ddi_info_cmd_t infocmd, void *arg,
39 39 void **result);
40 40 static int options_attach(dev_info_t *devi, ddi_attach_cmd_t cmd);
41 41 static int options_detach(dev_info_t *devi, ddi_detach_cmd_t cmd);
42 42 static dev_info_t *options_devi;
43 43
44 44 struct dev_ops options_ops = {
45 45
46 46 DEVO_REV, /* devo_rev, */
47 47 0, /* refcnt */
48 48 options_info, /* info */
49 49 nulldev, /* identify */
50 50 nulldev, /* probe */
51 51 options_attach, /* attach */
52 52 options_detach, /* detach */
53 53 nodev, /* reset */
54 54 (struct cb_ops *)0, /* driver operations */
55 55 (struct bus_ops *)0, /* bus operations */
56 56 nulldev, /* power */
57 57 ddi_quiesce_not_needed, /* quiesce */
58 58
59 59 };
60 60
61 61 /*
62 62 * Autoload Data and Autoload Entry
63 63 */
64 64
↓ open down ↓ |
64 lines elided |
↑ open up ↑ |
65 65 #include <sys/modctl.h>
66 66
67 67 extern struct mod_ops mod_driverops;
68 68 static struct modldrv modldrv = {
69 69 &mod_driverops, /* Type of module. This one is a driver */
70 70 "options driver", /* Name of the module. */
71 71 &options_ops, /* driver ops */
72 72 };
73 73
74 74 static struct modlinkage modlinkage = {
75 - MODREV_1, (void *)&modldrv
75 + MODREV_1, { (void *)&modldrv, NULL }
76 76 };
77 77
78 78 /*
79 79 * This is the driver initialization routine.
80 80 */
81 81
82 82 int
83 83 _init()
84 84 {
85 85 return (mod_install(&modlinkage));
86 86 }
87 87
88 88 int
89 89 _fini()
90 90 {
91 91 return (EBUSY);
92 92 }
93 93
94 94 int
95 95 _info(modinfop)
96 96 struct modinfo *modinfop;
97 97 {
98 98 return (mod_info(&modlinkage, modinfop));
99 99 }
100 100
101 101 /* ARGSUSED */
102 102 static int
103 103 options_info(dev_info_t *dip, ddi_info_cmd_t infocmd, void *arg, void **result)
104 104 {
105 105 register int error;
106 106
107 107 switch (infocmd) {
108 108 case DDI_INFO_DEVT2DEVINFO:
109 109 if (options_devi == NULL) {
110 110 error = DDI_FAILURE;
111 111 } else {
112 112 *result = (void *) options_devi;
113 113 error = DDI_SUCCESS;
114 114 }
115 115 break;
116 116 case DDI_INFO_DEVT2INSTANCE:
117 117 *result = (void *)0;
118 118 error = DDI_SUCCESS;
119 119 break;
120 120 default:
121 121 error = DDI_FAILURE;
122 122 }
123 123 return (error);
124 124 }
125 125
126 126 static int
127 127 options_attach(dev_info_t *devi, ddi_attach_cmd_t cmd)
128 128 {
129 129 switch (cmd) {
130 130 case DDI_ATTACH:
131 131 options_devi = devi;
132 132 return (DDI_SUCCESS);
133 133
134 134 case DDI_RESUME:
135 135 return (DDI_SUCCESS);
136 136
137 137 default:
138 138 return (DDI_FAILURE);
139 139 }
140 140 }
141 141
142 142 /*ARGSUSED*/
143 143 static int
144 144 options_detach(dev_info_t *devi, ddi_detach_cmd_t cmd)
145 145 {
146 146 switch (cmd) {
147 147 case DDI_SUSPEND:
148 148 return (DDI_SUCCESS);
149 149
150 150 case DDI_DETACH:
151 151 default:
152 152 return (DDI_FAILURE);
153 153 }
154 154 }
↓ open down ↓ |
69 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX