The thermal subsystem initialization miss an netlink unregistering
function in the error. Add it.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
result = thermal_register_governors();
if (result)
- goto error;
+ goto unregister_netlink;
result = class_register(&thermal_class);
if (result)
unregister_governors:
thermal_unregister_governors();
+unregister_netlink:
+ thermal_netlink_exit();
error:
ida_destroy(&thermal_tz_ida);
ida_destroy(&thermal_cdev_ida);
{
return genl_register_family(&thermal_gnl_family);
}
+
+void __init thermal_netlink_exit(void)
+{
+ genl_unregister_family(&thermal_gnl_family);
+}
/* 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);
return 0;
}
+static inline void __init thermal_netlink_exit(void) {}
+
#endif /* CONFIG_THERMAL_NETLINK */