Skip to content

Commit

Permalink
staging: unisys: visorbus: add error handling for dev_start_periodic_…
Browse files Browse the repository at this point in the history
…work

Report errors if we have a problem in dev_start_periodic_work.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
David Kershner authored and Greg Kroah-Hartman committed Mar 29, 2017
1 parent 3659955 commit b90194d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/staging/unisys/visorbus/visorbus_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,16 +464,17 @@ dev_periodic_work(unsigned long __opaque)
mod_timer(&dev->timer, jiffies + POLLJIFFIES_NORMALCHANNEL);
}

static void
static int
dev_start_periodic_work(struct visor_device *dev)
{
if (dev->being_removed || dev->timer_active)
return;
return -EINVAL;
/* now up by at least 2 */
get_device(&dev->device);
dev->timer.expires = jiffies + POLLJIFFIES_NORMALCHANNEL;
add_timer(&dev->timer);
dev->timer_active = true;
return 0;
}

static void
Expand Down

0 comments on commit b90194d

Please sign in to comment.