Commit 867a0e05 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: ak4117: Use setup_timer() and mod_timer()

No functional change, refactoring with the standard helpers.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent d80d05fc
...@@ -91,9 +91,7 @@ int snd_ak4117_create(struct snd_card *card, ak4117_read_t *read, ak4117_write_t ...@@ -91,9 +91,7 @@ int snd_ak4117_create(struct snd_card *card, ak4117_read_t *read, ak4117_write_t
chip->read = read; chip->read = read;
chip->write = write; chip->write = write;
chip->private_data = private_data; chip->private_data = private_data;
init_timer(&chip->timer); setup_timer(&chip->timer, snd_ak4117_timer, (unsigned long)chip);
chip->timer.data = (unsigned long)chip;
chip->timer.function = snd_ak4117_timer;
for (reg = 0; reg < 5; reg++) for (reg = 0; reg < 5; reg++)
chip->regmap[reg] = pgm[reg]; chip->regmap[reg] = pgm[reg];
...@@ -139,8 +137,7 @@ void snd_ak4117_reinit(struct ak4117 *chip) ...@@ -139,8 +137,7 @@ void snd_ak4117_reinit(struct ak4117 *chip)
/* release powerdown, everything is initialized now */ /* release powerdown, everything is initialized now */
reg_write(chip, AK4117_REG_PWRDN, old | AK4117_RST | AK4117_PWN); reg_write(chip, AK4117_REG_PWRDN, old | AK4117_RST | AK4117_PWN);
chip->init = 0; chip->init = 0;
chip->timer.expires = 1 + jiffies; mod_timer(&chip->timer, 1 + jiffies);
add_timer(&chip->timer);
} }
static unsigned int external_rate(unsigned char rcs1) static unsigned int external_rate(unsigned char rcs1)
...@@ -540,8 +537,7 @@ static void snd_ak4117_timer(unsigned long data) ...@@ -540,8 +537,7 @@ static void snd_ak4117_timer(unsigned long data)
if (chip->init) if (chip->init)
return; return;
snd_ak4117_check_rate_and_errors(chip, 0); snd_ak4117_check_rate_and_errors(chip, 0);
chip->timer.expires = 1 + jiffies; mod_timer(&chip->timer, 1 + jiffies);
add_timer(&chip->timer);
} }
EXPORT_SYMBOL(snd_ak4117_create); EXPORT_SYMBOL(snd_ak4117_create);
......
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