platform/x86: GPD pocket fan: Use default values when wrong modparams are given
authorHans de Goede <hdegoede@redhat.com>
Mon, 6 Jan 2020 14:42:18 +0000 (15:42 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Jan 2020 18:48:43 +0000 (19:48 +0100)
commit3d11eaab07308027db94dfad256d77d6dad13d8f
tree1d541dec0c43c911d53de2e0b3cedb8ce2f72397
parent3e4008fbdf93fae25dd025a157b7126e3639acc7
platform/x86: GPD pocket fan: Use default values when wrong modparams are given

commit 6ae01050e49f0080ae30575d9b45a6d4a3d7ee23 upstream.

Use our default values when wrong module-parameters are given, instead of
refusing to load. Refusing to load leaves the fan at the BIOS default
setting, which is "Off". The CPU's thermal throttling should protect the
system from damage, but not-loading is really not the best fallback in this
case.

This commit fixes this by re-setting module-parameter values to their
defaults if they are out of range, instead of failing the probe with
-EINVAL.

Cc: stable@vger.kernel.org
Cc: Jason Anderson <jasona.594@gmail.com>
Reported-by: Jason Anderson <jasona.594@gmail.com>
Fixes: 594ce6db326e ("platform/x86: GPD pocket fan: Use a min-speed of 2 while charging")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/platform/x86/gpd-pocket-fan.c