public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] thermal/core: Fix unregistering netlink at thermal init time
@ 2023-01-18 21:11 Daniel Lezcano
  2023-01-18 21:11 ` [PATCH 2/5] thermal/core: Remove unneeded ida_destroy() Daniel Lezcano
                   ` (4 more replies)
  0 siblings, 5 replies; 25+ messages in thread
From: Daniel Lezcano @ 2023-01-18 21:11 UTC (permalink / raw)
  To: daniel.lezcano, rafael; +Cc: linux-pm, Amit Kucheria, Zhang Rui, open list

The thermal subsystem initialization miss an netlink unregistering
function in the error. Add it.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/thermal/thermal_core.c    | 4 +++-
 drivers/thermal/thermal_netlink.c | 5 +++++
 drivers/thermal/thermal_netlink.h | 3 +++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index d9a3d9566d73..fddafcee5e6f 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -1606,7 +1606,7 @@ static int __init thermal_init(void)
 
 	result = thermal_register_governors();
 	if (result)
-		goto error;
+		goto unregister_netlink;
 
 	result = class_register(&thermal_class);
 	if (result)
@@ -1621,6 +1621,8 @@ static int __init thermal_init(void)
 
 unregister_governors:
 	thermal_unregister_governors();
+unregister_netlink:
+	thermal_netlink_exit();
 error:
 	ida_destroy(&thermal_tz_ida);
 	ida_destroy(&thermal_cdev_ida);
diff --git a/drivers/thermal/thermal_netlink.c b/drivers/thermal/thermal_netlink.c
index 75943b06dbe7..08bc46c3ec7b 100644
--- a/drivers/thermal/thermal_netlink.c
+++ b/drivers/thermal/thermal_netlink.c
@@ -699,3 +699,8 @@ int __init thermal_netlink_init(void)
 {
 	return genl_register_family(&thermal_gnl_family);
 }
+
+void __init thermal_netlink_exit(void)
+{
+	genl_unregister_family(&thermal_gnl_family);
+}
diff --git a/drivers/thermal/thermal_netlink.h b/drivers/thermal/thermal_netlink.h
index 1052f523188d..0a9987c3bc57 100644
--- a/drivers/thermal/thermal_netlink.h
+++ b/drivers/thermal/thermal_netlink.h
@@ -13,6 +13,7 @@ struct thermal_genl_cpu_caps {
 /* Netlink notification function */
 #ifdef CONFIG_THERMAL_NETLINK
 int __init thermal_netlink_init(void);
+void __init thermal_netlink_exit(void);
 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);
@@ -115,4 +116,6 @@ static inline int thermal_genl_cpu_capability_event(int count, struct thermal_ge
 	return 0;
 }
 
+static inline void __init thermal_netlink_exit(void) {}
+
 #endif /* CONFIG_THERMAL_NETLINK */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2023-01-20 14:25 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-18 21:11 [PATCH 1/5] thermal/core: Fix unregistering netlink at thermal init time Daniel Lezcano
2023-01-18 21:11 ` [PATCH 2/5] thermal/core: Remove unneeded ida_destroy() Daniel Lezcano
2023-01-18 21:11 ` [PATCH 3/5] thermal/core: Remove unneeded mutex_destroy() Daniel Lezcano
2023-01-19  7:41   ` Zhang, Rui
2023-01-19  9:30     ` Daniel Lezcano
2023-01-19 12:11       ` Rafael J. Wysocki
2023-01-19 12:48         ` Daniel Lezcano
2023-01-19 13:24           ` Rafael J. Wysocki
2023-01-19 14:13             ` Daniel Lezcano
2023-01-19 15:05               ` Rafael J. Wysocki
2023-01-19 16:39                 ` Daniel Lezcano
2023-01-19 17:21                   ` Rafael J. Wysocki
2023-01-20 14:09                     ` Zhang, Rui
2023-01-20 14:13                       ` Rafael J. Wysocki
2023-01-18 21:11 ` [PATCH 4/5] thermal/core: Move the thermal trip code to a dedicated file Daniel Lezcano
2023-01-19  2:39   ` kernel test robot
2023-01-19  7:24   ` Zhang, Rui
2023-01-18 21:11 ` [PATCH 5/5] thermal/core: Sort the trip points when registering a thermal zone Daniel Lezcano
2023-01-19  7:22   ` Zhang, Rui
2023-01-19 10:25     ` Daniel Lezcano
2023-01-19 16:50       ` Zhang, Rui
2023-01-19 13:28 ` [PATCH 1/5] thermal/core: Fix unregistering netlink at thermal init time Rafael J. Wysocki
2023-01-19 13:40   ` Daniel Lezcano
2023-01-19 13:45     ` Rafael J. Wysocki
2023-01-19 14:07       ` Daniel Lezcano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox