diff options
author | Frans Klaver <frans.klaver@xsens.com> | 2015-01-14 09:15:41 +0100 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2015-01-20 13:58:30 +0100 |
commit | 5c3faad29b266da015e3726cff6556df5c3cd9f5 (patch) | |
tree | f1c8a009fd4077eec507174728bb8336b67aae9d /drivers/power/reset | |
parent | power: reset: ltc2952: drop empty suspend/resume functions (diff) | |
download | linux-5c3faad29b266da015e3726cff6556df5c3cd9f5.tar.xz linux-5c3faad29b266da015e3726cff6556df5c3cd9f5.zip |
power: reset: ltc2952: cleanup control flow in poweroff_handler
ltc2952_poweroff_handler uses gotos to return from the function. Since
we don't do cleanups exiting this function, just return IRQ_HANDLED on
the spot and be done with it.
While at it, remove the variable 'ret'. It was never used very much.
Signed-off-by: Frans Klaver <frans.klaver@xsens.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers/power/reset')
-rw-r--r-- | drivers/power/reset/ltc2952-poweroff.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/power/reset/ltc2952-poweroff.c b/drivers/power/reset/ltc2952-poweroff.c index d29948762ceb..736af3961019 100644 --- a/drivers/power/reset/ltc2952-poweroff.c +++ b/drivers/power/reset/ltc2952-poweroff.c @@ -153,29 +153,21 @@ ltc2952_poweroff_timer_trigger(struct hrtimer *timer) */ static irqreturn_t ltc2952_poweroff_handler(int irq, void *dev_id) { - int ret; struct ltc2952_poweroff *data = dev_id; - if (data->kernel_panic) - goto irq_ok; - - if (hrtimer_active(&data->timer_wde)) { + if (data->kernel_panic || hrtimer_active(&data->timer_wde)) { /* shutdown is already triggered, nothing to do any more */ - goto irq_ok; + return IRQ_HANDLED; } if (!hrtimer_active(&data->timer_trigger)) { - ret = hrtimer_start(&data->timer_trigger, data->trigger_delay, - HRTIMER_MODE_REL); - - if (ret) + if (hrtimer_start(&data->timer_trigger, data->trigger_delay, + HRTIMER_MODE_REL)) dev_err(data->dev, "unable to start the wait timer\n"); } else { - ret = hrtimer_cancel(&data->timer_trigger); + hrtimer_cancel(&data->timer_trigger); /* omitting return value check, timer should have been valid */ } - -irq_ok: return IRQ_HANDLED; } |