Blame view

drivers/acpi/fan.c 9 KB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  /*
   *  acpi_fan.c - ACPI Fan Driver ($Revision: 29 $)
   *
   *  Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
   *  Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
   *
   * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   *
   *  This program is free software; you can redistribute it and/or modify
   *  it under the terms of the GNU General Public License as published by
   *  the Free Software Foundation; either version 2 of the License, or (at
   *  your option) any later version.
   *
   *  This program is distributed in the hope that it will be useful, but
   *  WITHOUT ANY WARRANTY; without even the implied warranty of
   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   *  General Public License for more details.
   *
   *  You should have received a copy of the GNU General Public License along
   *  with this program; if not, write to the Free Software Foundation, Inc.,
   *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
   *
   * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   */
  
  #include <linux/kernel.h>
  #include <linux/module.h>
  #include <linux/init.h>
  #include <linux/types.h>
  #include <linux/proc_fs.h>
  #include <linux/seq_file.h>
  #include <asm/uaccess.h>
05a83d972   Zhang Rui   ACPI: register AC...
33
  #include <linux/thermal.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
34
35
  #include <acpi/acpi_bus.h>
  #include <acpi/acpi_drivers.h>
a192a9580   Len Brown   ACPI: Move defini...
36
  #define PREFIX "ACPI: "
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
37
  #define ACPI_FAN_CLASS			"fan"
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
38
  #define ACPI_FAN_FILE_STATE		"state"
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
39
40
  
  #define _COMPONENT		ACPI_FAN_COMPONENT
f52fd66d2   Len Brown   ACPI: clean up AC...
41
  ACPI_MODULE_NAME("fan");
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
42

f52fd66d2   Len Brown   ACPI: clean up AC...
43
  MODULE_AUTHOR("Paul Diefenbaugh");
7cda93e00   Len Brown   ACPI: delete extr...
44
  MODULE_DESCRIPTION("ACPI Fan Driver");
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
45
  MODULE_LICENSE("GPL");
4be44fcd3   Len Brown   [ACPI] Lindent al...
46
47
  static int acpi_fan_add(struct acpi_device *device);
  static int acpi_fan_remove(struct acpi_device *device, int type);
ec68373c0   Len Brown   Revert "ACPI: Fan...
48
49
  static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state);
  static int acpi_fan_resume(struct acpi_device *device);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
50

1ba90e3a8   Thomas Renninger   ACPI: autoload mo...
51
52
53
54
55
  static const struct acpi_device_id fan_device_ids[] = {
  	{"PNP0C0B", 0},
  	{"", 0},
  };
  MODULE_DEVICE_TABLE(acpi, fan_device_ids);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
56
  static struct acpi_driver acpi_fan_driver = {
c2b6705b7   Len Brown   ACPI: fix acpi_dr...
57
  	.name = "fan",
4be44fcd3   Len Brown   [ACPI] Lindent al...
58
  	.class = ACPI_FAN_CLASS,
1ba90e3a8   Thomas Renninger   ACPI: autoload mo...
59
  	.ids = fan_device_ids,
4be44fcd3   Len Brown   [ACPI] Lindent al...
60
61
62
  	.ops = {
  		.add = acpi_fan_add,
  		.remove = acpi_fan_remove,
ec68373c0   Len Brown   Revert "ACPI: Fan...
63
64
  		.suspend = acpi_fan_suspend,
  		.resume = acpi_fan_resume,
4be44fcd3   Len Brown   [ACPI] Lindent al...
65
  		},
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
66
  };
05a83d972   Zhang Rui   ACPI: register AC...
67
  /* thermal cooling device callbacks */
6503e5df0   Matthew Garrett   thermal: use inte...
68
69
  static int fan_get_max_state(struct thermal_cooling_device *cdev, unsigned long
  			     *state)
05a83d972   Zhang Rui   ACPI: register AC...
70
71
  {
  	/* ACPI fan device only support two states: ON/OFF */
6503e5df0   Matthew Garrett   thermal: use inte...
72
73
  	*state = 1;
  	return 0;
05a83d972   Zhang Rui   ACPI: register AC...
74
  }
6503e5df0   Matthew Garrett   thermal: use inte...
75
76
  static int fan_get_cur_state(struct thermal_cooling_device *cdev, unsigned long
  			     *state)
05a83d972   Zhang Rui   ACPI: register AC...
77
78
  {
  	struct acpi_device *device = cdev->devdata;
05a83d972   Zhang Rui   ACPI: register AC...
79
  	int result;
6503e5df0   Matthew Garrett   thermal: use inte...
80
  	int acpi_state;
05a83d972   Zhang Rui   ACPI: register AC...
81
82
83
  
  	if (!device)
  		return -EINVAL;
6503e5df0   Matthew Garrett   thermal: use inte...
84
  	result = acpi_bus_get_power(device->handle, &acpi_state);
05a83d972   Zhang Rui   ACPI: register AC...
85
86
  	if (result)
  		return result;
6503e5df0   Matthew Garrett   thermal: use inte...
87
88
89
  	*state = (acpi_state == ACPI_STATE_D3 ? 0 :
  		 (acpi_state == ACPI_STATE_D0 ? 1 : -1));
  	return 0;
05a83d972   Zhang Rui   ACPI: register AC...
90
91
92
  }
  
  static int
6503e5df0   Matthew Garrett   thermal: use inte...
93
  fan_set_cur_state(struct thermal_cooling_device *cdev, unsigned long state)
05a83d972   Zhang Rui   ACPI: register AC...
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
  {
  	struct acpi_device *device = cdev->devdata;
  	int result;
  
  	if (!device || (state != 0 && state != 1))
  		return -EINVAL;
  
  	result = acpi_bus_set_power(device->handle,
  				state ? ACPI_STATE_D0 : ACPI_STATE_D3);
  
  	return result;
  }
  
  static struct thermal_cooling_device_ops fan_cooling_ops = {
  	.get_max_state = fan_get_max_state,
  	.get_cur_state = fan_get_cur_state,
  	.set_cur_state = fan_set_cur_state,
  };
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
112
113
114
  /* --------------------------------------------------------------------------
                                FS Interface (/proc)
     -------------------------------------------------------------------------- */
05a83d972   Zhang Rui   ACPI: register AC...
115
  #ifdef CONFIG_ACPI_PROCFS
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
116

4be44fcd3   Len Brown   [ACPI] Lindent al...
117
  static struct proc_dir_entry *acpi_fan_dir;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
118

4be44fcd3   Len Brown   [ACPI] Lindent al...
119
  static int acpi_fan_read_state(struct seq_file *seq, void *offset)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
120
  {
968fc5dc2   Alexey Starikovskiy   ACPI: Fan: fan de...
121
  	struct acpi_device *device = seq->private;
4be44fcd3   Len Brown   [ACPI] Lindent al...
122
  	int state = 0;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
123

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
124

968fc5dc2   Alexey Starikovskiy   ACPI: Fan: fan de...
125
126
  	if (device) {
  		if (acpi_bus_get_power(device->handle, &state))
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
127
128
129
130
131
  			seq_printf(seq, "status:                  ERROR
  ");
  		else
  			seq_printf(seq, "status:                  %s
  ",
4be44fcd3   Len Brown   [ACPI] Lindent al...
132
  				   !state ? "on" : "off");
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
133
  	}
d550d98d3   Patrick Mochel   ACPI: delete trac...
134
  	return 0;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
135
136
137
138
139
140
141
142
  }
  
  static int acpi_fan_state_open_fs(struct inode *inode, struct file *file)
  {
  	return single_open(file, acpi_fan_read_state, PDE(inode)->data);
  }
  
  static ssize_t
4be44fcd3   Len Brown   [ACPI] Lindent al...
143
144
  acpi_fan_write_state(struct file *file, const char __user * buffer,
  		     size_t count, loff_t * ppos)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
145
  {
4be44fcd3   Len Brown   [ACPI] Lindent al...
146
  	int result = 0;
50dd09697   Jan Engelhardt   ACPI: Remove unne...
147
  	struct seq_file *m = file->private_data;
968fc5dc2   Alexey Starikovskiy   ACPI: Fan: fan de...
148
  	struct acpi_device *device = m->private;
6594d87eb   Yi Yang   ACPI: fix acpi fa...
149
  	char state_string[3] = { '\0' };
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
150

968fc5dc2   Alexey Starikovskiy   ACPI: Fan: fan de...
151
  	if (count > sizeof(state_string) - 1)
d550d98d3   Patrick Mochel   ACPI: delete trac...
152
  		return -EINVAL;
4be44fcd3   Len Brown   [ACPI] Lindent al...
153

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
154
  	if (copy_from_user(state_string, buffer, count))
d550d98d3   Patrick Mochel   ACPI: delete trac...
155
  		return -EFAULT;
4be44fcd3   Len Brown   [ACPI] Lindent al...
156

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
157
  	state_string[count] = '\0';
6594d87eb   Yi Yang   ACPI: fix acpi fa...
158
159
160
161
162
163
164
  	if ((state_string[0] < '0') || (state_string[0] > '3'))
  		return -EINVAL;
  	if (state_string[1] == '
  ')
  		state_string[1] = '\0';
  	if (state_string[1] != '\0')
  		return -EINVAL;
4be44fcd3   Len Brown   [ACPI] Lindent al...
165

968fc5dc2   Alexey Starikovskiy   ACPI: Fan: fan de...
166
  	result = acpi_bus_set_power(device->handle,
4be44fcd3   Len Brown   [ACPI] Lindent al...
167
  				    simple_strtoul(state_string, NULL, 0));
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
168
  	if (result)
d550d98d3   Patrick Mochel   ACPI: delete trac...
169
  		return result;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
170

d550d98d3   Patrick Mochel   ACPI: delete trac...
171
  	return count;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
172
  }
d75080328   Arjan van de Ven   ACPI: add 'const'...
173
  static const struct file_operations acpi_fan_state_ops = {
4be44fcd3   Len Brown   [ACPI] Lindent al...
174
175
176
177
178
  	.open = acpi_fan_state_open_fs,
  	.read = seq_read,
  	.write = acpi_fan_write_state,
  	.llseek = seq_lseek,
  	.release = single_release,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
179
180
  	.owner = THIS_MODULE,
  };
4be44fcd3   Len Brown   [ACPI] Lindent al...
181
  static int acpi_fan_add_fs(struct acpi_device *device)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
182
  {
4be44fcd3   Len Brown   [ACPI] Lindent al...
183
  	struct proc_dir_entry *entry = NULL;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
184

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
185
186
  
  	if (!device)
d550d98d3   Patrick Mochel   ACPI: delete trac...
187
  		return -EINVAL;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
188
189
190
  
  	if (!acpi_device_dir(device)) {
  		acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
4be44fcd3   Len Brown   [ACPI] Lindent al...
191
  						     acpi_fan_dir);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
192
  		if (!acpi_device_dir(device))
d550d98d3   Patrick Mochel   ACPI: delete trac...
193
  			return -ENODEV;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
194
195
196
  	}
  
  	/* 'status' [R/W] */
cf7acfab0   Denis V. Lunev   acpi: use non-rac...
197
198
199
200
201
  	entry = proc_create_data(ACPI_FAN_FILE_STATE,
  				 S_IFREG | S_IRUGO | S_IWUSR,
  				 acpi_device_dir(device),
  				 &acpi_fan_state_ops,
  				 device);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
202
  	if (!entry)
d550d98d3   Patrick Mochel   ACPI: delete trac...
203
  		return -ENODEV;
d550d98d3   Patrick Mochel   ACPI: delete trac...
204
  	return 0;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
205
  }
4be44fcd3   Len Brown   [ACPI] Lindent al...
206
  static int acpi_fan_remove_fs(struct acpi_device *device)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
207
  {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
208
209
  
  	if (acpi_device_dir(device)) {
4be44fcd3   Len Brown   [ACPI] Lindent al...
210
  		remove_proc_entry(ACPI_FAN_FILE_STATE, acpi_device_dir(device));
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
211
212
213
  		remove_proc_entry(acpi_device_bid(device), acpi_fan_dir);
  		acpi_device_dir(device) = NULL;
  	}
d550d98d3   Patrick Mochel   ACPI: delete trac...
214
  	return 0;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
215
  }
05a83d972   Zhang Rui   ACPI: register AC...
216
217
218
219
220
  #else
  static int acpi_fan_add_fs(struct acpi_device *device)
  {
  	return 0;
  }
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
221

05a83d972   Zhang Rui   ACPI: register AC...
222
223
224
225
226
  static int acpi_fan_remove_fs(struct acpi_device *device)
  {
  	return 0;
  }
  #endif
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
227
228
229
  /* --------------------------------------------------------------------------
                                   Driver Interface
     -------------------------------------------------------------------------- */
4be44fcd3   Len Brown   [ACPI] Lindent al...
230
  static int acpi_fan_add(struct acpi_device *device)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
231
  {
4be44fcd3   Len Brown   [ACPI] Lindent al...
232
  	int result = 0;
4be44fcd3   Len Brown   [ACPI] Lindent al...
233
  	int state = 0;
05a83d972   Zhang Rui   ACPI: register AC...
234
  	struct thermal_cooling_device *cdev;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
235
236
  
  	if (!device)
d550d98d3   Patrick Mochel   ACPI: delete trac...
237
  		return -EINVAL;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
238

c65ade4dc   Pavel Machek   [ACPI] whitespace
239
  	strcpy(acpi_device_name(device), "Fan");
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
240
  	strcpy(acpi_device_class(device), ACPI_FAN_CLASS);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
241

dc8c2b274   Patrick Mochel   ACPI: fan: Use ac...
242
  	result = acpi_bus_get_power(device->handle, &state);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
243
  	if (result) {
6468463ab   Len Brown   ACPI: un-export A...
244
245
  		printk(KERN_ERR PREFIX "Reading power state
  ");
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
246
247
  		goto end;
  	}
ec68373c0   Len Brown   Revert "ACPI: Fan...
248
249
250
  	device->flags.force_power_state = 1;
  	acpi_bus_set_power(device->handle, state);
  	device->flags.force_power_state = 0;
05a83d972   Zhang Rui   ACPI: register AC...
251
252
  	cdev = thermal_cooling_device_register("Fan", device,
  						&fan_cooling_ops);
19b36780e   Thomas Sujith   ACPI fan: extract...
253
254
255
256
  	if (IS_ERR(cdev)) {
  		result = PTR_ERR(cdev);
  		goto end;
  	}
9030062f3   Julia Lawall   ACPI: elide a non...
257

13c411570   Mike Travis   ACPI: Remove repe...
258
259
  	dev_dbg(&device->dev, "registered as cooling_device%d
  ", cdev->id);
9030062f3   Julia Lawall   ACPI: elide a non...
260

db89b4f0d   Pavel Machek   ACPI: catch calls...
261
  	device->driver_data = cdev;
9030062f3   Julia Lawall   ACPI: elide a non...
262
263
264
265
  	result = sysfs_create_link(&device->dev.kobj,
  				   &cdev->device.kobj,
  				   "thermal_cooling");
  	if (result)
fc3a8828b   Greg Kroah-Hartman   driver core: fix ...
266
267
268
  		dev_err(&device->dev, "Failed to create sysfs link "
  			"'thermal_cooling'
  ");
9030062f3   Julia Lawall   ACPI: elide a non...
269
270
271
272
273
  
  	result = sysfs_create_link(&cdev->device.kobj,
  				   &device->dev.kobj,
  				   "device");
  	if (result)
fc3a8828b   Greg Kroah-Hartman   driver core: fix ...
274
275
276
  		dev_err(&device->dev, "Failed to create sysfs link "
  			"'device'
  ");
05a83d972   Zhang Rui   ACPI: register AC...
277

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
278
279
280
281
282
283
  	result = acpi_fan_add_fs(device);
  	if (result)
  		goto end;
  
  	printk(KERN_INFO PREFIX "%s [%s] (%s)
  ",
4be44fcd3   Len Brown   [ACPI] Lindent al...
284
285
  	       acpi_device_name(device), acpi_device_bid(device),
  	       !device->power.state ? "on" : "off");
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
286

4be44fcd3   Len Brown   [ACPI] Lindent al...
287
        end:
d550d98d3   Patrick Mochel   ACPI: delete trac...
288
  	return result;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
289
  }
4be44fcd3   Len Brown   [ACPI] Lindent al...
290
  static int acpi_fan_remove(struct acpi_device *device, int type)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
291
  {
05a83d972   Zhang Rui   ACPI: register AC...
292
293
294
  	struct thermal_cooling_device *cdev = acpi_driver_data(device);
  
  	if (!device || !cdev)
d550d98d3   Patrick Mochel   ACPI: delete trac...
295
  		return -EINVAL;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
296

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
297
  	acpi_fan_remove_fs(device);
05a83d972   Zhang Rui   ACPI: register AC...
298
299
300
  	sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
  	sysfs_remove_link(&cdev->device.kobj, "device");
  	thermal_cooling_device_unregister(cdev);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
301

d550d98d3   Patrick Mochel   ACPI: delete trac...
302
  	return 0;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
303
  }
ec68373c0   Len Brown   Revert "ACPI: Fan...
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
  static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state)
  {
  	if (!device)
  		return -EINVAL;
  
  	acpi_bus_set_power(device->handle, ACPI_STATE_D0);
  
  	return AE_OK;
  }
  
  static int acpi_fan_resume(struct acpi_device *device)
  {
  	int result = 0;
  	int power_state = 0;
  
  	if (!device)
  		return -EINVAL;
  
  	result = acpi_bus_get_power(device->handle, &power_state);
  	if (result) {
55ac9a018   Lin Ming   ACPI: replace ACP...
324
325
326
  		printk(KERN_ERR PREFIX
  				  "Error reading fan power state
  ");
ec68373c0   Len Brown   Revert "ACPI: Fan...
327
328
329
330
331
332
333
334
335
  		return result;
  	}
  
  	device->flags.force_power_state = 1;
  	acpi_bus_set_power(device->handle, power_state);
  	device->flags.force_power_state = 0;
  
  	return result;
  }
4be44fcd3   Len Brown   [ACPI] Lindent al...
336
  static int __init acpi_fan_init(void)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
337
  {
c65ade4dc   Pavel Machek   [ACPI] whitespace
338
  	int result = 0;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
339

3c6028405   Len Brown   ACPI: fan: build ...
340
  #ifdef CONFIG_ACPI_PROCFS
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
341
342
  	acpi_fan_dir = proc_mkdir(ACPI_FAN_CLASS, acpi_root_dir);
  	if (!acpi_fan_dir)
d550d98d3   Patrick Mochel   ACPI: delete trac...
343
  		return -ENODEV;
3c6028405   Len Brown   ACPI: fan: build ...
344
  #endif
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
345
346
347
  
  	result = acpi_bus_register_driver(&acpi_fan_driver);
  	if (result < 0) {
934231de7   Liang Li   ACPI: fan: fix un...
348
  #ifdef CONFIG_ACPI_PROCFS
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
349
  		remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir);
934231de7   Liang Li   ACPI: fan: fix un...
350
  #endif
d550d98d3   Patrick Mochel   ACPI: delete trac...
351
  		return -ENODEV;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
352
  	}
d550d98d3   Patrick Mochel   ACPI: delete trac...
353
  	return 0;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
354
  }
4be44fcd3   Len Brown   [ACPI] Lindent al...
355
  static void __exit acpi_fan_exit(void)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
356
  {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
357
358
359
360
  
  	acpi_bus_unregister_driver(&acpi_fan_driver);
  
  	remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir);
d550d98d3   Patrick Mochel   ACPI: delete trac...
361
  	return;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
362
  }
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
363
364
  module_init(acpi_fan_init);
  module_exit(acpi_fan_exit);