diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-02-28 19:12:19 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-02-28 21:00:31 -0500 |
commit | af06216a8ef1c430cc6ad22b562f3a11a512c5dd (patch) | |
tree | 8c258db7e165cc160a8c85c3d06afa5f1e07a063 | |
parent | dbc39ec4b69de34e2c2c937131649cc4a104283f (diff) |
ACPI: Fix build for CONFIG_NET unset
Several ACPI drivers fail to build if CONFIG_NET is unset, because
they refer to things depending on CONFIG_THERMAL that in turn depends
on CONFIG_NET. However, CONFIG_THERMAL doesn't really need to depend
on CONFIG_NET, because the only part of it requiring CONFIG_NET is
the netlink interface in thermal_sys.c.
Put the netlink interface in thermal_sys.c under #ifdef CONFIG_NET
and remove the dependency of CONFIG_THERMAL on CONFIG_NET from
drivers/thermal/Kconfig.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Len Brown <lenb@kernel.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Luming Yu <luming.yu@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/thermal/Kconfig | 1 | ||||
-rw-r--r-- | drivers/thermal/thermal_sys.c | 40 | ||||
-rw-r--r-- | include/linux/thermal.h | 8 |
3 files changed, 29 insertions, 20 deletions
diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index f7a5dba3ca23..bf7c687519ef 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig | |||
@@ -4,7 +4,6 @@ | |||
4 | 4 | ||
5 | menuconfig THERMAL | 5 | menuconfig THERMAL |
6 | tristate "Generic Thermal sysfs driver" | 6 | tristate "Generic Thermal sysfs driver" |
7 | depends on NET | ||
8 | help | 7 | help |
9 | Generic Thermal Sysfs driver offers a generic mechanism for | 8 | Generic Thermal Sysfs driver offers a generic mechanism for |
10 | thermal management. Usually it's made up of one or more thermal | 9 | thermal management. Usually it's made up of one or more thermal |
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c index 7d0e63c79280..713b7ea4a607 100644 --- a/drivers/thermal/thermal_sys.c +++ b/drivers/thermal/thermal_sys.c | |||
@@ -62,20 +62,6 @@ static DEFINE_MUTEX(thermal_list_lock); | |||
62 | 62 | ||
63 | static unsigned int thermal_event_seqnum; | 63 | static unsigned int thermal_event_seqnum; |
64 | 64 | ||
65 | static struct genl_family thermal_event_genl_family = { | ||
66 | .id = GENL_ID_GENERATE, | ||
67 | .name = THERMAL_GENL_FAMILY_NAME, | ||
68 | .version = THERMAL_GENL_VERSION, | ||
69 | .maxattr = THERMAL_GENL_ATTR_MAX, | ||
70 | }; | ||
71 | |||
72 | static struct genl_multicast_group thermal_event_mcgrp = { | ||
73 | .name = THERMAL_GENL_MCAST_GROUP_NAME, | ||
74 | }; | ||
75 | |||
76 | static int genetlink_init(void); | ||
77 | static void genetlink_exit(void); | ||
78 | |||
79 | static int get_idr(struct idr *idr, struct mutex *lock, int *id) | 65 | static int get_idr(struct idr *idr, struct mutex *lock, int *id) |
80 | { | 66 | { |
81 | int err; | 67 | int err; |
@@ -1225,6 +1211,18 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz) | |||
1225 | 1211 | ||
1226 | EXPORT_SYMBOL(thermal_zone_device_unregister); | 1212 | EXPORT_SYMBOL(thermal_zone_device_unregister); |
1227 | 1213 | ||
1214 | #ifdef CONFIG_NET | ||
1215 | static struct genl_family thermal_event_genl_family = { | ||
1216 | .id = GENL_ID_GENERATE, | ||
1217 | .name = THERMAL_GENL_FAMILY_NAME, | ||
1218 | .version = THERMAL_GENL_VERSION, | ||
1219 | .maxattr = THERMAL_GENL_ATTR_MAX, | ||
1220 | }; | ||
1221 | |||
1222 | static struct genl_multicast_group thermal_event_mcgrp = { | ||
1223 | .name = THERMAL_GENL_MCAST_GROUP_NAME, | ||
1224 | }; | ||
1225 | |||
1228 | int generate_netlink_event(u32 orig, enum events event) | 1226 | int generate_netlink_event(u32 orig, enum events event) |
1229 | { | 1227 | { |
1230 | struct sk_buff *skb; | 1228 | struct sk_buff *skb; |
@@ -1301,6 +1299,15 @@ static int genetlink_init(void) | |||
1301 | return result; | 1299 | return result; |
1302 | } | 1300 | } |
1303 | 1301 | ||
1302 | static void genetlink_exit(void) | ||
1303 | { | ||
1304 | genl_unregister_family(&thermal_event_genl_family); | ||
1305 | } | ||
1306 | #else /* !CONFIG_NET */ | ||
1307 | static inline int genetlink_init(void) { return 0; } | ||
1308 | static inline void genetlink_exit(void) {} | ||
1309 | #endif /* !CONFIG_NET */ | ||
1310 | |||
1304 | static int __init thermal_init(void) | 1311 | static int __init thermal_init(void) |
1305 | { | 1312 | { |
1306 | int result = 0; | 1313 | int result = 0; |
@@ -1316,11 +1323,6 @@ static int __init thermal_init(void) | |||
1316 | return result; | 1323 | return result; |
1317 | } | 1324 | } |
1318 | 1325 | ||
1319 | static void genetlink_exit(void) | ||
1320 | { | ||
1321 | genl_unregister_family(&thermal_event_genl_family); | ||
1322 | } | ||
1323 | |||
1324 | static void __exit thermal_exit(void) | 1326 | static void __exit thermal_exit(void) |
1325 | { | 1327 | { |
1326 | class_unregister(&thermal_class); | 1328 | class_unregister(&thermal_class); |
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 8651556dbd52..d3ec89fb4122 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h | |||
@@ -172,6 +172,14 @@ void thermal_zone_device_update(struct thermal_zone_device *); | |||
172 | struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, | 172 | struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, |
173 | const struct thermal_cooling_device_ops *); | 173 | const struct thermal_cooling_device_ops *); |
174 | void thermal_cooling_device_unregister(struct thermal_cooling_device *); | 174 | void thermal_cooling_device_unregister(struct thermal_cooling_device *); |
175 | |||
176 | #ifdef CONFIG_NET | ||
175 | extern int generate_netlink_event(u32 orig, enum events event); | 177 | extern int generate_netlink_event(u32 orig, enum events event); |
178 | #else | ||
179 | static inline int generate_netlink_event(u32 orig, enum events event) | ||
180 | { | ||
181 | return 0; | ||
182 | } | ||
183 | #endif | ||
176 | 184 | ||
177 | #endif /* __THERMAL_H__ */ | 185 | #endif /* __THERMAL_H__ */ |