thermal: netlink: Add thermal_group_has_listeners() helper
authorStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Thu, 28 Dec 2023 10:02:48 +0000 (11:02 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 28 Dec 2023 18:56:40 +0000 (19:56 +0100)
commit04c3b03044034ce50886f2c0d1c595ff25f45085
tree40e9431edb4cbcb59750b32374ca49f362234cab
parent5eb4f413ad60db7c4b11c4d331b04f2909c8ba14
thermal: netlink: Add thermal_group_has_listeners() helper

Add a helper function to check if there are listeners for
thermal_gnl_family multicast groups.

For now use it to avoid unnecessary allocations and sending
thermal genl messages when there are no recipients.

In the future, in conjunction with (not yet implemented) notification
of change in the netlink socket group membership, this helper can be
used to open/close hardware interfaces based on the presence of
user space subscribers.

Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/thermal/thermal_netlink.c