[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240131120535.933424-3-stanislaw.gruszka@linux.intel.com>
Date: Wed, 31 Jan 2024 13:05:34 +0100
From: Stanislaw Gruszka <stanislaw.gruszka@...ux.intel.com>
To: linux-pm@...r.kernel.org
Cc: "Rafael J. Wysocki" <rafael@...nel.org>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
netdev@...r.kernel.org
Subject: [PATCH 2/3] thermal: netlink: Export thermal_group_has_listeners()
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@...ux.intel.com>
---
drivers/thermal/thermal_netlink.c | 7 +------
drivers/thermal/thermal_netlink.h | 11 +++++++++++
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/drivers/thermal/thermal_netlink.c b/drivers/thermal/thermal_netlink.c
index 569e4fa62f73..44e8df2751ba 100644
--- a/drivers/thermal/thermal_netlink.c
+++ b/drivers/thermal/thermal_netlink.c
@@ -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);
}
diff --git a/drivers/thermal/thermal_netlink.h b/drivers/thermal/thermal_netlink.h
index 0a9987c3bc57..3272a966f404 100644
--- a/drivers/thermal/thermal_netlink.h
+++ b/drivers/thermal/thermal_netlink.h
@@ -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;
--
2.34.1
Powered by blists - more mailing lists