Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 233748
b: refs/heads/master
c: af06216
h: refs/heads/master
v: v3
  • Loading branch information
Rafael J. Wysocki authored and Linus Torvalds committed Mar 1, 2011
1 parent a326ddf commit 72e2110
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dbc39ec4b69de34e2c2c937131649cc4a104283f
refs/heads/master: af06216a8ef1c430cc6ad22b562f3a11a512c5dd
1 change: 0 additions & 1 deletion trunk/drivers/thermal/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

menuconfig THERMAL
tristate "Generic Thermal sysfs driver"
depends on NET
help
Generic Thermal Sysfs driver offers a generic mechanism for
thermal management. Usually it's made up of one or more thermal
Expand Down
40 changes: 21 additions & 19 deletions trunk/drivers/thermal/thermal_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,6 @@ static DEFINE_MUTEX(thermal_list_lock);

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)
{
int err;
Expand Down Expand Up @@ -1225,6 +1211,18 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz)

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)
{
struct sk_buff *skb;
Expand Down Expand Up @@ -1301,6 +1299,15 @@ static int genetlink_init(void)
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)
{
int result = 0;
Expand All @@ -1316,11 +1323,6 @@ static int __init thermal_init(void)
return result;
}

static void genetlink_exit(void)
{
genl_unregister_family(&thermal_event_genl_family);
}

static void __exit thermal_exit(void)
{
class_unregister(&thermal_class);
Expand Down
8 changes: 8 additions & 0 deletions trunk/include/linux/thermal.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@ void thermal_zone_device_update(struct thermal_zone_device *);
struct thermal_cooling_device *thermal_cooling_device_register(char *, void *,
const struct thermal_cooling_device_ops *);
void thermal_cooling_device_unregister(struct thermal_cooling_device *);

#ifdef CONFIG_NET
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__ */

0 comments on commit 72e2110

Please sign in to comment.