Commit f69d64de authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'platform-drivers-x86-v4.12-2' of git://git.infradead.org/linux-platform-drivers-x86

Pull x86 platform driver fix from Darren Hart:
 "Just a single patch to fix an oops in the intel_telemetry_debugfs
  module load/unload"

* tag 'platform-drivers-x86-v4.12-2' of git://git.infradead.org/linux-platform-drivers-x86:
  platform/x86: intel_telemetry_debugfs: fix oops when load/unload module
parents e78e4626 bf5d0081
...@@ -97,11 +97,9 @@ ...@@ -97,11 +97,9 @@
} \ } \
} }
#ifdef CONFIG_PM_SLEEP
static u8 suspend_prep_ok; static u8 suspend_prep_ok;
static u32 suspend_shlw_ctr_temp, suspend_deep_ctr_temp; static u32 suspend_shlw_ctr_temp, suspend_deep_ctr_temp;
static u64 suspend_shlw_res_temp, suspend_deep_res_temp; static u64 suspend_shlw_res_temp, suspend_deep_res_temp;
#endif
struct telemetry_susp_stats { struct telemetry_susp_stats {
u32 shlw_swake_ctr; u32 shlw_swake_ctr;
...@@ -807,7 +805,6 @@ static const struct file_operations telem_ioss_trc_verb_ops = { ...@@ -807,7 +805,6 @@ static const struct file_operations telem_ioss_trc_verb_ops = {
.release = single_release, .release = single_release,
}; };
#ifdef CONFIG_PM_SLEEP
static int pm_suspend_prep_cb(void) static int pm_suspend_prep_cb(void)
{ {
struct telemetry_evtlog evtlog[TELEM_MAX_OS_ALLOCATED_EVENTS]; struct telemetry_evtlog evtlog[TELEM_MAX_OS_ALLOCATED_EVENTS];
...@@ -937,7 +934,6 @@ static int pm_notification(struct notifier_block *this, ...@@ -937,7 +934,6 @@ static int pm_notification(struct notifier_block *this,
static struct notifier_block pm_notifier = { static struct notifier_block pm_notifier = {
.notifier_call = pm_notification, .notifier_call = pm_notification,
}; };
#endif /* CONFIG_PM_SLEEP */
static int __init telemetry_debugfs_init(void) static int __init telemetry_debugfs_init(void)
{ {
...@@ -960,14 +956,13 @@ static int __init telemetry_debugfs_init(void) ...@@ -960,14 +956,13 @@ static int __init telemetry_debugfs_init(void)
if (err < 0) if (err < 0)
return -EINVAL; return -EINVAL;
#ifdef CONFIG_PM_SLEEP
register_pm_notifier(&pm_notifier); register_pm_notifier(&pm_notifier);
#endif /* CONFIG_PM_SLEEP */
debugfs_conf->telemetry_dbg_dir = debugfs_create_dir("telemetry", NULL); debugfs_conf->telemetry_dbg_dir = debugfs_create_dir("telemetry", NULL);
if (!debugfs_conf->telemetry_dbg_dir) if (!debugfs_conf->telemetry_dbg_dir) {
return -ENOMEM; err = -ENOMEM;
goto out_pm;
}
f = debugfs_create_file("pss_info", S_IFREG | S_IRUGO, f = debugfs_create_file("pss_info", S_IFREG | S_IRUGO,
debugfs_conf->telemetry_dbg_dir, NULL, debugfs_conf->telemetry_dbg_dir, NULL,
...@@ -1014,6 +1009,8 @@ static int __init telemetry_debugfs_init(void) ...@@ -1014,6 +1009,8 @@ static int __init telemetry_debugfs_init(void)
out: out:
debugfs_remove_recursive(debugfs_conf->telemetry_dbg_dir); debugfs_remove_recursive(debugfs_conf->telemetry_dbg_dir);
debugfs_conf->telemetry_dbg_dir = NULL; debugfs_conf->telemetry_dbg_dir = NULL;
out_pm:
unregister_pm_notifier(&pm_notifier);
return err; return err;
} }
...@@ -1022,6 +1019,7 @@ static void __exit telemetry_debugfs_exit(void) ...@@ -1022,6 +1019,7 @@ static void __exit telemetry_debugfs_exit(void)
{ {
debugfs_remove_recursive(debugfs_conf->telemetry_dbg_dir); debugfs_remove_recursive(debugfs_conf->telemetry_dbg_dir);
debugfs_conf->telemetry_dbg_dir = NULL; debugfs_conf->telemetry_dbg_dir = NULL;
unregister_pm_notifier(&pm_notifier);
} }
late_initcall(telemetry_debugfs_init); late_initcall(telemetry_debugfs_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment