@@ -13,11 +13,6 @@
#include "thermal_core.h"
-enum thermal_genl_multicast_groups {
- THERMAL_GENL_SAMPLING_GROUP = 0,
- THERMAL_GENL_EVENT_GROUP = 1,
-};
-
static const struct genl_multicast_group thermal_genl_mcgrps[] = {
[THERMAL_GENL_SAMPLING_GROUP] = { .name = THERMAL_GENL_SAMPLING_GROUP_NAME, },
[THERMAL_GENL_EVENT_GROUP] = { .name = THERMAL_GENL_EVENT_GROUP_NAME, },
@@ -76,7 +71,7 @@ typedef int (*cb_t)(struct param *);
static struct genl_family thermal_gnl_family;
-static int thermal_group_has_listeners(enum thermal_genl_multicast_groups group)
+int thermal_group_has_listeners(enum thermal_genl_multicast_groups group)
{
return genl_has_listeners(&thermal_gnl_family, &init_net, group);
}
@@ -10,10 +10,16 @@ struct thermal_genl_cpu_caps {
int efficiency;
};
+enum thermal_genl_multicast_groups {
+ THERMAL_GENL_SAMPLING_GROUP = 0,
+ THERMAL_GENL_EVENT_GROUP = 1,
+};
+
/* Netlink notification function */
#ifdef CONFIG_THERMAL_NETLINK
int __init thermal_netlink_init(void);
void __init thermal_netlink_exit(void);
+int thermal_group_has_listeners(enum thermal_genl_multicast_groups group);
int thermal_notify_tz_create(int tz_id, const char *name);
int thermal_notify_tz_delete(int tz_id);
int thermal_notify_tz_enable(int tz_id);
@@ -38,6 +44,11 @@ static inline int thermal_netlink_init(void)
return 0;
}
+static inline int thermal_group_has_listeners(enum thermal_genl_multicast_groups group)
+{
+ return 0;
+}
+
static inline int thermal_notify_tz_create(int tz_id, const char *name)
{
return 0;
Let drivers use thermal_group_has_listners(). The intel_hfi driver needs it to enable HFI only when user-space consumers are present. Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> --- drivers/thermal/thermal_netlink.c | 7 +------ drivers/thermal/thermal_netlink.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 6 deletions(-)