platform/x86: GPD pocket fan: Stop work on suspend
authorHans de Goede <hdegoede@redhat.com>
Fri, 19 Jan 2018 20:47:09 +0000 (21:47 +0100)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 29 Jan 2018 18:44:16 +0000 (20:44 +0200)
Stop the work on suspend, otherwise it may run between our suspend method
running and the system suspending, possibly restarting the fan which
we've just stopped.

Note we already requeue the work on resume, so that we get a fresh speed
at resume.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/gpd-pocket-fan.c

index 2652eb40e5bcabf4dd261cf287fb4060fab6d0c1..2d645c505f8190b02b875177869fa158032375f3 100644 (file)
@@ -177,6 +177,7 @@ static int gpd_pocket_fan_suspend(struct device *dev)
 {
        struct gpd_pocket_fan_data *fan = dev_get_drvdata(dev);
 
+       cancel_delayed_work_sync(&fan->work);
        gpd_pocket_fan_set_speed(fan, gpd_pocket_fan_min_speed());
        return 0;
 }