提交 af06216a 编写于 作者: R Rafael J. Wysocki 提交者: Linus Torvalds

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: NRafael J. Wysocki <rjw@sisk.pl>
Acked-by: NRandy 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: NLinus Torvalds <torvalds@linux-foundation.org>
上级 dbc39ec4
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
menuconfig THERMAL menuconfig THERMAL
tristate "Generic Thermal sysfs driver" tristate "Generic Thermal sysfs driver"
depends on NET
help help
Generic Thermal Sysfs driver offers a generic mechanism for Generic Thermal Sysfs driver offers a generic mechanism for
thermal management. Usually it's made up of one or more thermal thermal management. Usually it's made up of one or more thermal
......
...@@ -62,20 +62,6 @@ static DEFINE_MUTEX(thermal_list_lock); ...@@ -62,20 +62,6 @@ static DEFINE_MUTEX(thermal_list_lock);
static unsigned int thermal_event_seqnum; static unsigned int thermal_event_seqnum;
static struct genl_family thermal_event_genl_family = {
.id = GENL_ID_GENERATE,
.name = THERMAL_GENL_FAMILY_NAME,
.version = THERMAL_GENL_VERSION,
.maxattr = THERMAL_GENL_ATTR_MAX,
};
static struct genl_multicast_group thermal_event_mcgrp = {
.name = THERMAL_GENL_MCAST_GROUP_NAME,
};
static int genetlink_init(void);
static void genetlink_exit(void);
static int get_idr(struct idr *idr, struct mutex *lock, int *id) static int get_idr(struct idr *idr, struct mutex *lock, int *id)
{ {
int err; int err;
...@@ -1225,6 +1211,18 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz) ...@@ -1225,6 +1211,18 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz)
EXPORT_SYMBOL(thermal_zone_device_unregister); EXPORT_SYMBOL(thermal_zone_device_unregister);
#ifdef CONFIG_NET
static struct genl_family thermal_event_genl_family = {
.id = GENL_ID_GENERATE,
.name = THERMAL_GENL_FAMILY_NAME,
.version = THERMAL_GENL_VERSION,
.maxattr = THERMAL_GENL_ATTR_MAX,
};
static struct genl_multicast_group thermal_event_mcgrp = {
.name = THERMAL_GENL_MCAST_GROUP_NAME,
};
int generate_netlink_event(u32 orig, enum events event) int generate_netlink_event(u32 orig, enum events event)
{ {
struct sk_buff *skb; struct sk_buff *skb;
...@@ -1301,6 +1299,15 @@ static int genetlink_init(void) ...@@ -1301,6 +1299,15 @@ static int genetlink_init(void)
return result; return result;
} }
static void genetlink_exit(void)
{
genl_unregister_family(&thermal_event_genl_family);
}
#else /* !CONFIG_NET */
static inline int genetlink_init(void) { return 0; }
static inline void genetlink_exit(void) {}
#endif /* !CONFIG_NET */
static int __init thermal_init(void) static int __init thermal_init(void)
{ {
int result = 0; int result = 0;
...@@ -1316,11 +1323,6 @@ static int __init thermal_init(void) ...@@ -1316,11 +1323,6 @@ static int __init thermal_init(void)
return result; return result;
} }
static void genetlink_exit(void)
{
genl_unregister_family(&thermal_event_genl_family);
}
static void __exit thermal_exit(void) static void __exit thermal_exit(void)
{ {
class_unregister(&thermal_class); class_unregister(&thermal_class);
......
...@@ -172,6 +172,14 @@ void thermal_zone_device_update(struct thermal_zone_device *); ...@@ -172,6 +172,14 @@ void thermal_zone_device_update(struct thermal_zone_device *);
struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, struct thermal_cooling_device *thermal_cooling_device_register(char *, void *,
const struct thermal_cooling_device_ops *); const struct thermal_cooling_device_ops *);
void thermal_cooling_device_unregister(struct thermal_cooling_device *); void thermal_cooling_device_unregister(struct thermal_cooling_device *);
#ifdef CONFIG_NET
extern int generate_netlink_event(u32 orig, enum events event); extern int generate_netlink_event(u32 orig, enum events event);
#else
static inline int generate_netlink_event(u32 orig, enum events event)
{
return 0;
}
#endif
#endif /* __THERMAL_H__ */ #endif /* __THERMAL_H__ */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册