device: Simplify device_pending_reset()
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Fri, 2 Sep 2011 10:34:56 +0000 (13:34 +0300)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 12 Sep 2011 09:40:49 +0000 (11:40 +0200)
The g_source for device_pending_reset() is going to be removed when
the callback function returns FALSE. Thus simplify the code with a
few lines.

src/device.c

index a5b815f..d8ab1fc 100644 (file)
@@ -221,11 +221,8 @@ static gboolean device_pending_reset(gpointer user_data)
        DBG("device %p", device);
 
        /* Power request timedout, reset power pending state. */
-       if (device->pending_timeout > 0) {
-               g_source_remove(device->pending_timeout);
-               device->pending_timeout = 0;
-               device->powered_pending = PENDING_NONE;
-       }
+       device->pending_timeout = 0;
+       device->powered_pending = PENDING_NONE;
 
        return FALSE;
 }