Commit 476d60b1 authored by Mattia Dongili's avatar Mattia Dongili Committed by Andy Shevchenko

platform/x86: sony-laptop: Make resuming thermal profile safer

The thermal handle object may fail initialization when the module is
loaded in the first place. Avoid attempting to use it on resume then.

Fixes: 6d232b29 ("ACPICA: Dispatcher: always generate buffer objects for ASL create_field() operator")
Reported-by: default avatarDominik Mierzejewski <dominik@greysector.net>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=207491Signed-off-by: default avatarMattia Dongili <malattia@linux.it>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parent 47828d22
...@@ -2288,7 +2288,12 @@ static void sony_nc_thermal_cleanup(struct platform_device *pd) ...@@ -2288,7 +2288,12 @@ static void sony_nc_thermal_cleanup(struct platform_device *pd)
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static void sony_nc_thermal_resume(void) static void sony_nc_thermal_resume(void)
{ {
unsigned int status = sony_nc_thermal_mode_get(); int status;
if (!th_handle)
return;
status = sony_nc_thermal_mode_get();
if (status != th_handle->mode) if (status != th_handle->mode)
sony_nc_thermal_mode_set(th_handle->mode); sony_nc_thermal_mode_set(th_handle->mode);
......
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