Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Rafael J. Wysocki and committed by
Linus Torvalds
af06216a dbc39ec4

+29 -20
-1
drivers/thermal/Kconfig
··· 4 4 5 5 menuconfig THERMAL 6 6 tristate "Generic Thermal sysfs driver" 7 - depends on NET 8 7 help 9 8 Generic Thermal Sysfs driver offers a generic mechanism for 10 9 thermal management. Usually it's made up of one or more thermal
+21 -19
drivers/thermal/thermal_sys.c
··· 62 62 63 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 65 static int get_idr(struct idr *idr, struct mutex *lock, int *id) 80 66 { 81 67 int err; ··· 1211 1225 1212 1226 EXPORT_SYMBOL(thermal_zone_device_unregister); 1213 1227 1228 + #ifdef CONFIG_NET 1229 + static struct genl_family thermal_event_genl_family = { 1230 + .id = GENL_ID_GENERATE, 1231 + .name = THERMAL_GENL_FAMILY_NAME, 1232 + .version = THERMAL_GENL_VERSION, 1233 + .maxattr = THERMAL_GENL_ATTR_MAX, 1234 + }; 1235 + 1236 + static struct genl_multicast_group thermal_event_mcgrp = { 1237 + .name = THERMAL_GENL_MCAST_GROUP_NAME, 1238 + }; 1239 + 1214 1240 int generate_netlink_event(u32 orig, enum events event) 1215 1241 { 1216 1242 struct sk_buff *skb; ··· 1299 1301 return result; 1300 1302 } 1301 1303 1304 + static void genetlink_exit(void) 1305 + { 1306 + genl_unregister_family(&thermal_event_genl_family); 1307 + } 1308 + #else /* !CONFIG_NET */ 1309 + static inline int genetlink_init(void) { return 0; } 1310 + static inline void genetlink_exit(void) {} 1311 + #endif /* !CONFIG_NET */ 1312 + 1302 1313 static int __init thermal_init(void) 1303 1314 { 1304 1315 int result = 0; ··· 1321 1314 } 1322 1315 result = genetlink_init(); 1323 1316 return result; 1324 - } 1325 - 1326 - static void genetlink_exit(void) 1327 - { 1328 - genl_unregister_family(&thermal_event_genl_family); 1329 1317 } 1330 1318 1331 1319 static void __exit thermal_exit(void)
+8
include/linux/thermal.h
··· 172 172 struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, 173 173 const struct thermal_cooling_device_ops *); 174 174 void thermal_cooling_device_unregister(struct thermal_cooling_device *); 175 + 176 + #ifdef CONFIG_NET 175 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 185 #endif /* __THERMAL_H__ */