Commit b90194d9 authored by David Kershner's avatar David Kershner Committed by Greg Kroah-Hartman

staging: unisys: visorbus: add error handling for dev_start_periodic_work

Report errors if we have a problem in dev_start_periodic_work.
Signed-off-by: default avatarDavid Kershner <david.kershner@unisys.com>
Reviewed-by: default avatarReviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3659955a
...@@ -464,16 +464,17 @@ dev_periodic_work(unsigned long __opaque) ...@@ -464,16 +464,17 @@ dev_periodic_work(unsigned long __opaque)
mod_timer(&dev->timer, jiffies + POLLJIFFIES_NORMALCHANNEL); mod_timer(&dev->timer, jiffies + POLLJIFFIES_NORMALCHANNEL);
} }
static void static int
dev_start_periodic_work(struct visor_device *dev) dev_start_periodic_work(struct visor_device *dev)
{ {
if (dev->being_removed || dev->timer_active) if (dev->being_removed || dev->timer_active)
return; return -EINVAL;
/* now up by at least 2 */ /* now up by at least 2 */
get_device(&dev->device); get_device(&dev->device);
dev->timer.expires = jiffies + POLLJIFFIES_NORMALCHANNEL; dev->timer.expires = jiffies + POLLJIFFIES_NORMALCHANNEL;
add_timer(&dev->timer); add_timer(&dev->timer);
dev->timer_active = true; dev->timer_active = true;
return 0;
} }
static void static void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment