aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-01-19 05:29:25 -0500
committerTakashi Iwai <tiwai@suse.de>2015-01-19 05:32:27 -0500
commit867a0e057f69a06e032f779efd4325ef632084af (patch)
treeedbe9dcf974505c54822125dd671847e1334ce47
parentd80d05fcca1771ff68e0b385459fabb3eb938e98 (diff)
ALSA: ak4117: Use setup_timer() and mod_timer()
No functional change, refactoring with the standard helpers. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/i2c/other/ak4117.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sound/i2c/other/ak4117.c b/sound/i2c/other/ak4117.c
index 88452e899bd9..48848909a5a9 100644
--- a/sound/i2c/other/ak4117.c
+++ b/sound/i2c/other/ak4117.c
@@ -91,9 +91,7 @@ int snd_ak4117_create(struct snd_card *card, ak4117_read_t *read, ak4117_write_t
91 chip->read = read; 91 chip->read = read;
92 chip->write = write; 92 chip->write = write;
93 chip->private_data = private_data; 93 chip->private_data = private_data;
94 init_timer(&chip->timer); 94 setup_timer(&chip->timer, snd_ak4117_timer, (unsigned long)chip);
95 chip->timer.data = (unsigned long)chip;
96 chip->timer.function = snd_ak4117_timer;
97 95
98 for (reg = 0; reg < 5; reg++) 96 for (reg = 0; reg < 5; reg++)
99 chip->regmap[reg] = pgm[reg]; 97 chip->regmap[reg] = pgm[reg];
@@ -139,8 +137,7 @@ void snd_ak4117_reinit(struct ak4117 *chip)
139 /* release powerdown, everything is initialized now */ 137 /* release powerdown, everything is initialized now */
140 reg_write(chip, AK4117_REG_PWRDN, old | AK4117_RST | AK4117_PWN); 138 reg_write(chip, AK4117_REG_PWRDN, old | AK4117_RST | AK4117_PWN);
141 chip->init = 0; 139 chip->init = 0;
142 chip->timer.expires = 1 + jiffies; 140 mod_timer(&chip->timer, 1 + jiffies);
143 add_timer(&chip->timer);
144} 141}
145 142
146static unsigned int external_rate(unsigned char rcs1) 143static unsigned int external_rate(unsigned char rcs1)
@@ -540,8 +537,7 @@ static void snd_ak4117_timer(unsigned long data)
540 if (chip->init) 537 if (chip->init)
541 return; 538 return;
542 snd_ak4117_check_rate_and_errors(chip, 0); 539 snd_ak4117_check_rate_and_errors(chip, 0);
543 chip->timer.expires = 1 + jiffies; 540 mod_timer(&chip->timer, 1 + jiffies);
544 add_timer(&chip->timer);
545} 541}
546 542
547EXPORT_SYMBOL(snd_ak4117_create); 543EXPORT_SYMBOL(snd_ak4117_create);