|
19 | 19 |
|
20 | 20 | #include "fan.h" |
21 | 21 |
|
22 | | -MODULE_AUTHOR("Paul Diefenbaugh"); |
23 | | -MODULE_DESCRIPTION("ACPI Fan Driver"); |
24 | | -MODULE_LICENSE("GPL"); |
25 | | - |
26 | | -static int acpi_fan_probe(struct platform_device *pdev); |
27 | | -static int acpi_fan_remove(struct platform_device *pdev); |
28 | | - |
29 | 22 | static const struct acpi_device_id fan_device_ids[] = { |
30 | 23 | ACPI_FAN_DEVICE_IDS, |
31 | 24 | {"", 0}, |
32 | 25 | }; |
33 | 26 | MODULE_DEVICE_TABLE(acpi, fan_device_ids); |
34 | 27 |
|
35 | | -#ifdef CONFIG_PM_SLEEP |
36 | | -static int acpi_fan_suspend(struct device *dev); |
37 | | -static int acpi_fan_resume(struct device *dev); |
38 | | -static const struct dev_pm_ops acpi_fan_pm = { |
39 | | - .resume = acpi_fan_resume, |
40 | | - .freeze = acpi_fan_suspend, |
41 | | - .thaw = acpi_fan_resume, |
42 | | - .restore = acpi_fan_resume, |
43 | | -}; |
44 | | -#define FAN_PM_OPS_PTR (&acpi_fan_pm) |
45 | | -#else |
46 | | -#define FAN_PM_OPS_PTR NULL |
47 | | -#endif |
48 | | - |
49 | | -static struct platform_driver acpi_fan_driver = { |
50 | | - .probe = acpi_fan_probe, |
51 | | - .remove = acpi_fan_remove, |
52 | | - .driver = { |
53 | | - .name = "acpi-fan", |
54 | | - .acpi_match_table = fan_device_ids, |
55 | | - .pm = FAN_PM_OPS_PTR, |
56 | | - }, |
57 | | -}; |
58 | | - |
59 | 28 | /* thermal cooling device callbacks */ |
60 | 29 | static int fan_get_max_state(struct thermal_cooling_device *cdev, unsigned long |
61 | 30 | *state) |
@@ -459,6 +428,33 @@ static int acpi_fan_resume(struct device *dev) |
459 | 428 |
|
460 | 429 | return result; |
461 | 430 | } |
| 431 | + |
| 432 | +static const struct dev_pm_ops acpi_fan_pm = { |
| 433 | + .resume = acpi_fan_resume, |
| 434 | + .freeze = acpi_fan_suspend, |
| 435 | + .thaw = acpi_fan_resume, |
| 436 | + .restore = acpi_fan_resume, |
| 437 | +}; |
| 438 | +#define FAN_PM_OPS_PTR (&acpi_fan_pm) |
| 439 | + |
| 440 | +#else |
| 441 | + |
| 442 | +#define FAN_PM_OPS_PTR NULL |
| 443 | + |
462 | 444 | #endif |
463 | 445 |
|
| 446 | +static struct platform_driver acpi_fan_driver = { |
| 447 | + .probe = acpi_fan_probe, |
| 448 | + .remove = acpi_fan_remove, |
| 449 | + .driver = { |
| 450 | + .name = "acpi-fan", |
| 451 | + .acpi_match_table = fan_device_ids, |
| 452 | + .pm = FAN_PM_OPS_PTR, |
| 453 | + }, |
| 454 | +}; |
| 455 | + |
464 | 456 | module_platform_driver(acpi_fan_driver); |
| 457 | + |
| 458 | +MODULE_AUTHOR("Paul Diefenbaugh"); |
| 459 | +MODULE_DESCRIPTION("ACPI Fan Driver"); |
| 460 | +MODULE_LICENSE("GPL"); |
0 commit comments