Skip to content

Commit f23470e

Browse files
Uwe Kleine-Königrafaeljw
authored andcommitted
ACPI: fan: Reorder symbols to get rid of a few forward declarations
Having the driver struct at the end of the file isn't only more usual, it also allows to drop a few forward declarations which are just useless repetition. While at it also move the MODULE_... macros to the end of the file. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 521a547 commit f23470e

File tree

1 file changed

+27
-31
lines changed

1 file changed

+27
-31
lines changed

drivers/acpi/fan_core.c

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -19,43 +19,12 @@
1919

2020
#include "fan.h"
2121

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-
2922
static const struct acpi_device_id fan_device_ids[] = {
3023
ACPI_FAN_DEVICE_IDS,
3124
{"", 0},
3225
};
3326
MODULE_DEVICE_TABLE(acpi, fan_device_ids);
3427

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-
5928
/* thermal cooling device callbacks */
6029
static int fan_get_max_state(struct thermal_cooling_device *cdev, unsigned long
6130
*state)
@@ -459,6 +428,33 @@ static int acpi_fan_resume(struct device *dev)
459428

460429
return result;
461430
}
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+
462444
#endif
463445

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+
464456
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

Comments
 (0)