]>
Commit | Line | Data |
---|---|---|
00e5a55c BS |
1 | From: Jean Delvare <jdelvare@suse.de> |
2 | Subject: Check for ACPI resource conflicts in hwmon drivers. | |
3 | Patch-mainline: 2.6.24-rc3-mm1 | |
4 | ||
5 | I've included all Super-I/O and PCI drivers. | |
6 | ||
7 | I've voluntarily left out: | |
8 | * Laptop specific and vendor-specific drivers: if they conflicted | |
9 | on any system, this would pretty much mean that they conflict on all | |
10 | systems, and we would know by now. | |
11 | * Legacy ISA drivers (lm78 and w83781d): they only support chips found | |
12 | on old designs were ACPI either wasn't supported or didn't deal with | |
13 | thermal management. | |
14 | * Drivers accessing the I/O resources indirectly (e.g. through SMBus): | |
15 | the check will be added where it belongs, i.e. in the bus drivers. | |
16 | ||
17 | Signed-off-by: Jean Delvare <jdelvare@suse.de> | |
18 | Signed-off-by: Thomas Renninger <trenn@suse.de> | |
19 | Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> | |
20 | Cc: Len Brown <lenb@kernel.org> | |
21 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | |
22 | --- | |
23 | ||
24 | drivers/hwmon/dme1737.c | 5 +++++ | |
25 | drivers/hwmon/f71805f.c | 5 +++++ | |
26 | drivers/hwmon/f71882fg.c | 5 +++++ | |
27 | drivers/hwmon/it87.c | 5 +++++ | |
28 | drivers/hwmon/pc87360.c | 6 ++++++ | |
29 | drivers/hwmon/pc87427.c | 5 +++++ | |
30 | drivers/hwmon/sis5595.c | 5 +++++ | |
31 | drivers/hwmon/smsc47b397.c | 5 +++++ | |
32 | drivers/hwmon/smsc47m1.c | 5 +++++ | |
33 | drivers/hwmon/via686a.c | 5 +++++ | |
34 | drivers/hwmon/vt1211.c | 5 +++++ | |
35 | drivers/hwmon/vt8231.c | 5 +++++ | |
36 | drivers/hwmon/w83627ehf.c | 6 ++++++ | |
37 | drivers/hwmon/w83627hf.c | 5 +++++ | |
38 | 14 files changed, 72 insertions(+) | |
39 | ||
40 | --- a/drivers/hwmon/dme1737.c | |
41 | +++ b/drivers/hwmon/dme1737.c | |
42 | @@ -34,6 +34,7 @@ | |
43 | #include <linux/hwmon-vid.h> | |
44 | #include <linux/err.h> | |
45 | #include <linux/mutex.h> | |
46 | +#include <linux/acpi.h> | |
47 | #include <asm/io.h> | |
48 | ||
49 | /* ISA device, if found */ | |
50 | @@ -2372,6 +2373,10 @@ static int __init dme1737_isa_device_add | |
51 | }; | |
52 | int err; | |
53 | ||
54 | + err = acpi_check_resource_conflict(&res); | |
55 | + if (err) | |
56 | + goto exit; | |
57 | + | |
58 | if (!(pdev = platform_device_alloc("dme1737", addr))) { | |
59 | printk(KERN_ERR "dme1737: Failed to allocate device.\n"); | |
60 | err = -ENOMEM; | |
61 | --- a/drivers/hwmon/f71805f.c | |
62 | +++ b/drivers/hwmon/f71805f.c | |
63 | @@ -39,6 +39,7 @@ | |
64 | #include <linux/mutex.h> | |
65 | #include <linux/sysfs.h> | |
66 | #include <linux/ioport.h> | |
67 | +#include <linux/acpi.h> | |
68 | #include <asm/io.h> | |
69 | ||
70 | static unsigned short force_id; | |
71 | @@ -1455,6 +1456,10 @@ static int __init f71805f_device_add(uns | |
72 | } | |
73 | ||
74 | res.name = pdev->name; | |
75 | + err = acpi_check_resource_conflict(&res); | |
76 | + if (err) | |
77 | + goto exit_device_put; | |
78 | + | |
79 | err = platform_device_add_resources(pdev, &res, 1); | |
80 | if (err) { | |
81 | printk(KERN_ERR DRVNAME ": Device resource addition failed " | |
82 | --- a/drivers/hwmon/f71882fg.c | |
83 | +++ b/drivers/hwmon/f71882fg.c | |
84 | @@ -27,6 +27,7 @@ | |
85 | #include <linux/hwmon-sysfs.h> | |
86 | #include <linux/err.h> | |
87 | #include <linux/mutex.h> | |
88 | +#include <linux/acpi.h> | |
89 | #include <asm/io.h> | |
90 | ||
91 | #define DRVNAME "f71882fg" | |
92 | @@ -892,6 +893,10 @@ static int __init f71882fg_device_add(un | |
93 | return -ENOMEM; | |
94 | ||
95 | res.name = f71882fg_pdev->name; | |
96 | + err = acpi_check_resource_conflict(&res); | |
97 | + if (err) | |
98 | + return err; | |
99 | + | |
100 | err = platform_device_add_resources(f71882fg_pdev, &res, 1); | |
101 | if (err) { | |
102 | printk(KERN_ERR DRVNAME ": Device resource addition failed\n"); | |
103 | --- a/drivers/hwmon/it87.c | |
104 | +++ b/drivers/hwmon/it87.c | |
105 | @@ -48,6 +48,7 @@ | |
106 | #include <linux/sysfs.h> | |
107 | #include <linux/string.h> | |
108 | #include <linux/dmi.h> | |
109 | +#include <linux/acpi.h> | |
110 | #include <asm/io.h> | |
111 | ||
112 | #define DRVNAME "it87" | |
113 | @@ -1535,6 +1536,10 @@ static int __init it87_device_add(unsign | |
114 | }; | |
115 | int err; | |
116 | ||
117 | + err = acpi_check_resource_conflict(&res); | |
118 | + if (err) | |
119 | + goto exit; | |
120 | + | |
121 | pdev = platform_device_alloc(DRVNAME, address); | |
122 | if (!pdev) { | |
123 | err = -ENOMEM; | |
124 | --- a/drivers/hwmon/pc87360.c | |
125 | +++ b/drivers/hwmon/pc87360.c | |
126 | @@ -43,6 +43,7 @@ | |
127 | #include <linux/hwmon-vid.h> | |
128 | #include <linux/err.h> | |
129 | #include <linux/mutex.h> | |
130 | +#include <linux/acpi.h> | |
131 | #include <asm/io.h> | |
132 | ||
133 | static u8 devid; | |
134 | @@ -1425,6 +1426,11 @@ static int __init pc87360_device_add(uns | |
135 | continue; | |
136 | res.start = extra_isa[i]; | |
137 | res.end = extra_isa[i] + PC87360_EXTENT - 1; | |
138 | + | |
139 | + err = acpi_check_resource_conflict(&res); | |
140 | + if (err) | |
141 | + goto exit_device_put; | |
142 | + | |
143 | err = platform_device_add_resources(pdev, &res, 1); | |
144 | if (err) { | |
145 | printk(KERN_ERR "pc87360: Device resource[%d] " | |
146 | --- a/drivers/hwmon/pc87427.c | |
147 | +++ b/drivers/hwmon/pc87427.c | |
148 | @@ -32,6 +32,7 @@ | |
149 | #include <linux/mutex.h> | |
150 | #include <linux/sysfs.h> | |
151 | #include <linux/ioport.h> | |
152 | +#include <linux/acpi.h> | |
153 | #include <asm/io.h> | |
154 | ||
155 | static unsigned short force_id; | |
156 | @@ -524,6 +525,10 @@ static int __init pc87427_device_add(uns | |
157 | }; | |
158 | int err; | |
159 | ||
160 | + err = acpi_check_resource_conflict(&res); | |
161 | + if (err) | |
162 | + goto exit; | |
163 | + | |
164 | pdev = platform_device_alloc(DRVNAME, address); | |
165 | if (!pdev) { | |
166 | err = -ENOMEM; | |
167 | --- a/drivers/hwmon/sis5595.c | |
168 | +++ b/drivers/hwmon/sis5595.c | |
169 | @@ -62,6 +62,7 @@ | |
170 | #include <linux/jiffies.h> | |
171 | #include <linux/mutex.h> | |
172 | #include <linux/sysfs.h> | |
173 | +#include <linux/acpi.h> | |
174 | #include <asm/io.h> | |
175 | ||
176 | ||
177 | @@ -727,6 +728,10 @@ static int __devinit sis5595_device_add( | |
178 | }; | |
179 | int err; | |
180 | ||
181 | + err = acpi_check_resource_conflict(&res); | |
182 | + if (err) | |
183 | + goto exit; | |
184 | + | |
185 | pdev = platform_device_alloc("sis5595", address); | |
186 | if (!pdev) { | |
187 | err = -ENOMEM; | |
188 | --- a/drivers/hwmon/smsc47b397.c | |
189 | +++ b/drivers/hwmon/smsc47b397.c | |
190 | @@ -36,6 +36,7 @@ | |
191 | #include <linux/err.h> | |
192 | #include <linux/init.h> | |
193 | #include <linux/mutex.h> | |
194 | +#include <linux/acpi.h> | |
195 | #include <asm/io.h> | |
196 | ||
197 | static unsigned short force_id; | |
198 | @@ -303,6 +304,10 @@ static int __init smsc47b397_device_add( | |
199 | }; | |
200 | int err; | |
201 | ||
202 | + err = acpi_check_resource_conflict(&res); | |
203 | + if (err) | |
204 | + goto exit; | |
205 | + | |
206 | pdev = platform_device_alloc(DRVNAME, address); | |
207 | if (!pdev) { | |
208 | err = -ENOMEM; | |
209 | --- a/drivers/hwmon/smsc47m1.c | |
210 | +++ b/drivers/hwmon/smsc47m1.c | |
211 | @@ -37,6 +37,7 @@ | |
212 | #include <linux/init.h> | |
213 | #include <linux/mutex.h> | |
214 | #include <linux/sysfs.h> | |
215 | +#include <linux/acpi.h> | |
216 | #include <asm/io.h> | |
217 | ||
218 | static unsigned short force_id; | |
219 | @@ -705,6 +706,10 @@ static int __init smsc47m1_device_add(un | |
220 | }; | |
221 | int err; | |
222 | ||
223 | + err = acpi_check_resource_conflict(&res); | |
224 | + if (err) | |
225 | + goto exit; | |
226 | + | |
227 | pdev = platform_device_alloc(DRVNAME, address); | |
228 | if (!pdev) { | |
229 | err = -ENOMEM; | |
230 | --- a/drivers/hwmon/via686a.c | |
231 | +++ b/drivers/hwmon/via686a.c | |
232 | @@ -41,6 +41,7 @@ | |
233 | #include <linux/init.h> | |
234 | #include <linux/mutex.h> | |
235 | #include <linux/sysfs.h> | |
236 | +#include <linux/acpi.h> | |
237 | #include <asm/io.h> | |
238 | ||
239 | ||
240 | @@ -783,6 +784,10 @@ static int __devinit via686a_device_add( | |
241 | }; | |
242 | int err; | |
243 | ||
244 | + err = acpi_check_resource_conflict(&res); | |
245 | + if (err) | |
246 | + goto exit; | |
247 | + | |
248 | pdev = platform_device_alloc("via686a", address); | |
249 | if (!pdev) { | |
250 | err = -ENOMEM; | |
251 | --- a/drivers/hwmon/vt1211.c | |
252 | +++ b/drivers/hwmon/vt1211.c | |
253 | @@ -32,6 +32,7 @@ | |
254 | #include <linux/err.h> | |
255 | #include <linux/mutex.h> | |
256 | #include <linux/ioport.h> | |
257 | +#include <linux/acpi.h> | |
258 | #include <asm/io.h> | |
259 | ||
260 | static int uch_config = -1; | |
261 | @@ -1259,6 +1260,10 @@ static int __init vt1211_device_add(unsi | |
262 | } | |
263 | ||
264 | res.name = pdev->name; | |
265 | + err = acpi_check_resource_conflict(&res); | |
266 | + if (err) | |
267 | + goto EXIT; | |
268 | + | |
269 | err = platform_device_add_resources(pdev, &res, 1); | |
270 | if (err) { | |
271 | printk(KERN_ERR DRVNAME ": Device resource addition failed " | |
272 | --- a/drivers/hwmon/vt8231.c | |
273 | +++ b/drivers/hwmon/vt8231.c | |
274 | @@ -35,6 +35,7 @@ | |
275 | #include <linux/hwmon-vid.h> | |
276 | #include <linux/err.h> | |
277 | #include <linux/mutex.h> | |
278 | +#include <linux/acpi.h> | |
279 | #include <asm/io.h> | |
280 | ||
281 | static int force_addr; | |
282 | @@ -894,6 +895,10 @@ static int __devinit vt8231_device_add(u | |
283 | }; | |
284 | int err; | |
285 | ||
286 | + err = acpi_check_resource_conflict(&res); | |
287 | + if (err) | |
288 | + goto exit; | |
289 | + | |
290 | pdev = platform_device_alloc("vt8231", address); | |
291 | if (!pdev) { | |
292 | err = -ENOMEM; | |
293 | --- a/drivers/hwmon/w83627ehf.c | |
294 | +++ b/drivers/hwmon/w83627ehf.c | |
295 | @@ -48,6 +48,7 @@ | |
296 | #include <linux/hwmon-vid.h> | |
297 | #include <linux/err.h> | |
298 | #include <linux/mutex.h> | |
299 | +#include <linux/acpi.h> | |
300 | #include <asm/io.h> | |
301 | #include "lm75.h" | |
302 | ||
303 | @@ -1544,6 +1545,11 @@ static int __init sensors_w83627ehf_init | |
304 | res.start = address + IOREGION_OFFSET; | |
305 | res.end = address + IOREGION_OFFSET + IOREGION_LENGTH - 1; | |
306 | res.flags = IORESOURCE_IO; | |
307 | + | |
308 | + err = acpi_check_resource_conflict(&res); | |
309 | + if (err) | |
310 | + goto exit; | |
311 | + | |
312 | err = platform_device_add_resources(pdev, &res, 1); | |
313 | if (err) { | |
314 | printk(KERN_ERR DRVNAME ": Device resource addition failed " | |
315 | --- a/drivers/hwmon/w83627hf.c | |
316 | +++ b/drivers/hwmon/w83627hf.c | |
317 | @@ -50,6 +50,7 @@ | |
318 | #include <linux/err.h> | |
319 | #include <linux/mutex.h> | |
320 | #include <linux/ioport.h> | |
321 | +#include <linux/acpi.h> | |
322 | #include <asm/io.h> | |
323 | #include "lm75.h" | |
324 | ||
325 | @@ -1793,6 +1794,10 @@ static int __init w83627hf_device_add(un | |
326 | }; | |
327 | int err; | |
328 | ||
329 | + err = acpi_check_resource_conflict(&res); | |
330 | + if (err) | |
331 | + goto exit; | |
332 | + | |
333 | pdev = platform_device_alloc(DRVNAME, address); | |
334 | if (!pdev) { | |
335 | err = -ENOMEM; |