]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: ozwpan: Fix wrong error check.
authorRupesh Gujare <rupesh.gujare@atmel.com>
Fri, 23 Aug 2013 15:11:01 +0000 (16:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Aug 2013 17:12:32 +0000 (10:12 -0700)
schedule_work() returns true if succeeded & false on failure,
error check was doing exactly reverse.
Also removes extra variable.

Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ozwpan/ozpd.c

index 5d24af3b4cd784c6b3afb13af74d7b92fae0f9ef..d39a3df4842bec09bc5f4911048c1e3ca69951a7 100644 (file)
@@ -261,17 +261,13 @@ void oz_pd_free(struct work_struct *work)
  */
 void oz_pd_destroy(struct oz_pd *pd)
 {
-       int ret;
-
        if (hrtimer_active(&pd->timeout))
                hrtimer_cancel(&pd->timeout);
        if (hrtimer_active(&pd->heartbeat))
                hrtimer_cancel(&pd->heartbeat);
 
        INIT_WORK(&pd->workitem, oz_pd_free);
-       ret = schedule_work(&pd->workitem);
-
-       if (ret)
+       if (!schedule_work(&pd->workitem))
                oz_pd_dbg(pd, ON, "failed to schedule workitem\n");
 }