[PATCH 03/11] PM: EM: Initialize the netlink notification during booting.

Changwoo Min posted 11 patches 6 months, 3 weeks ago
There is a newer version of this series
[PATCH 03/11] PM: EM: Initialize the netlink notification during booting.
Posted by Changwoo Min 6 months, 3 weeks ago
Initialize and register the netlink during booting. The initialization is
called at the postcore level, which is late enough after the generic
netlink is initialized.

Signed-off-by: Changwoo Min <changwoo@igalia.com>
---
 kernel/power/energy_model.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c
index ea7995a25780..b15b685c22bd 100644
--- a/kernel/power/energy_model.c
+++ b/kernel/power/energy_model.c
@@ -17,6 +17,8 @@
 #include <linux/sched/topology.h>
 #include <linux/slab.h>
 
+#include "em_netlink.h"
+
 /*
  * Mutex serializing the registrations of performance domains and letting
  * callbacks defined by drivers sleep.
@@ -936,3 +938,18 @@ void em_rebuild_sched_domains(void)
 	 */
 	schedule_work(&rebuild_sd_work);
 }
+
+static int __init em_init(void)
+{
+	int result;
+
+	result = em_netlink_init();
+	if (result)
+		goto error;
+
+	return 0;
+
+error:
+	return result;
+}
+postcore_initcall(em_init);
-- 
2.49.0