Commit 4cc58bde authored by Ben Hutchings's avatar Ben Hutchings Committed by Jeff Garzik

sfc: Use mod_timer() to set expiry and add_timer() together

Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 071f92d0
...@@ -27,10 +27,8 @@ static void blink_led_timer(unsigned long context) ...@@ -27,10 +27,8 @@ static void blink_led_timer(unsigned long context)
struct efx_blinker *bl = &efx->board_info.blinker; struct efx_blinker *bl = &efx->board_info.blinker;
efx->board_info.set_fault_led(efx, bl->state); efx->board_info.set_fault_led(efx, bl->state);
bl->state = !bl->state; bl->state = !bl->state;
if (bl->resubmit) { if (bl->resubmit)
bl->timer.expires = jiffies + BLINK_INTERVAL; mod_timer(&bl->timer, jiffies + BLINK_INTERVAL);
add_timer(&bl->timer);
}
} }
static void board_blink(struct efx_nic *efx, int blink) static void board_blink(struct efx_nic *efx, int blink)
...@@ -44,8 +42,7 @@ static void board_blink(struct efx_nic *efx, int blink) ...@@ -44,8 +42,7 @@ static void board_blink(struct efx_nic *efx, int blink)
blinker->state = 0; blinker->state = 0;
setup_timer(&blinker->timer, blink_led_timer, setup_timer(&blinker->timer, blink_led_timer,
(unsigned long)efx); (unsigned long)efx);
blinker->timer.expires = jiffies + BLINK_INTERVAL; mod_timer(&blinker->timer, jiffies + BLINK_INTERVAL);
add_timer(&blinker->timer);
} else { } else {
blinker->resubmit = 0; blinker->resubmit = 0;
if (blinker->timer.function) if (blinker->timer.function)
......
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