Skip to content

Commit 607d265

Browse files
committed
ACPI: thermal: Move acpi_thermal_driver definition
Move the definition of the acpi_thermal_driver structure closer to the initialization code that registes the driver, so some function forward declarations can be dropped. Also move the module information to the end of the file where it is usually located. No functional impact. Signed-off-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Daniel Lezcano <[email protected]>
1 parent bb5ab1f commit 607d265

File tree

1 file changed

+26
-35
lines changed

1 file changed

+26
-35
lines changed

drivers/acpi/thermal.c

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ do { \
7070
"Please report to [email protected]\n", str); \
7171
} while (0)
7272

73-
MODULE_AUTHOR("Paul Diefenbaugh");
74-
MODULE_DESCRIPTION("ACPI Thermal Zone Driver");
75-
MODULE_LICENSE("GPL");
76-
7773
static int act;
7874
module_param(act, int, 0644);
7975
MODULE_PARM_DESC(act, "Disable or override all lowest active trip points.");
@@ -100,37 +96,6 @@ MODULE_PARM_DESC(psv, "Disable or override all passive trip points.");
10096

10197
static struct workqueue_struct *acpi_thermal_pm_queue;
10298

103-
static int acpi_thermal_add(struct acpi_device *device);
104-
static void acpi_thermal_remove(struct acpi_device *device);
105-
static void acpi_thermal_notify(struct acpi_device *device, u32 event);
106-
107-
static const struct acpi_device_id thermal_device_ids[] = {
108-
{ACPI_THERMAL_HID, 0},
109-
{"", 0},
110-
};
111-
MODULE_DEVICE_TABLE(acpi, thermal_device_ids);
112-
113-
#ifdef CONFIG_PM_SLEEP
114-
static int acpi_thermal_suspend(struct device *dev);
115-
static int acpi_thermal_resume(struct device *dev);
116-
#else
117-
#define acpi_thermal_suspend NULL
118-
#define acpi_thermal_resume NULL
119-
#endif
120-
static SIMPLE_DEV_PM_OPS(acpi_thermal_pm, acpi_thermal_suspend, acpi_thermal_resume);
121-
122-
static struct acpi_driver acpi_thermal_driver = {
123-
.name = "thermal",
124-
.class = ACPI_THERMAL_CLASS,
125-
.ids = thermal_device_ids,
126-
.ops = {
127-
.add = acpi_thermal_add,
128-
.remove = acpi_thermal_remove,
129-
.notify = acpi_thermal_notify,
130-
},
131-
.drv.pm = &acpi_thermal_pm,
132-
};
133-
13499
struct acpi_thermal_state {
135100
u8 critical:1;
136101
u8 hot:1;
@@ -1129,7 +1094,29 @@ static int acpi_thermal_resume(struct device *dev)
11291094

11301095
return AE_OK;
11311096
}
1097+
#else
1098+
#define acpi_thermal_suspend NULL
1099+
#define acpi_thermal_resume NULL
11321100
#endif
1101+
static SIMPLE_DEV_PM_OPS(acpi_thermal_pm, acpi_thermal_suspend, acpi_thermal_resume);
1102+
1103+
static const struct acpi_device_id thermal_device_ids[] = {
1104+
{ACPI_THERMAL_HID, 0},
1105+
{"", 0},
1106+
};
1107+
MODULE_DEVICE_TABLE(acpi, thermal_device_ids);
1108+
1109+
static struct acpi_driver acpi_thermal_driver = {
1110+
.name = "thermal",
1111+
.class = ACPI_THERMAL_CLASS,
1112+
.ids = thermal_device_ids,
1113+
.ops = {
1114+
.add = acpi_thermal_add,
1115+
.remove = acpi_thermal_remove,
1116+
.notify = acpi_thermal_notify,
1117+
},
1118+
.drv.pm = &acpi_thermal_pm,
1119+
};
11331120

11341121
static int thermal_act(const struct dmi_system_id *d) {
11351122
if (act == 0) {
@@ -1235,3 +1222,7 @@ static void __exit acpi_thermal_exit(void)
12351222

12361223
module_init(acpi_thermal_init);
12371224
module_exit(acpi_thermal_exit);
1225+
1226+
MODULE_AUTHOR("Paul Diefenbaugh");
1227+
MODULE_DESCRIPTION("ACPI Thermal Zone Driver");
1228+
MODULE_LICENSE("GPL");

0 commit comments

Comments
 (0)