Commit 08fd8325 authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by Takashi Iwai

ALSA:: ctxfi: cthw20k1: Replace mdelay() with msleep()

hw_pll_init(), hw_reset_dac() and hw_card_init() are never
called in atomic context.
They calls mdelay() to busily wait, which is not necessary.
mdelay() can be replaced with msleep().

This is found by a static analysis tool named DCNS written by myself.
Signed-off-by: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent df3f0347
...@@ -1319,7 +1319,7 @@ static int hw_pll_init(struct hw *hw, unsigned int rsr) ...@@ -1319,7 +1319,7 @@ static int hw_pll_init(struct hw *hw, unsigned int rsr)
break; break;
hw_write_20kx(hw, PLLCTL, pllctl); hw_write_20kx(hw, PLLCTL, pllctl);
mdelay(40); msleep(40);
} }
if (i >= 3) { if (i >= 3) {
dev_alert(hw->card->dev, "PLL initialization failed!!!\n"); dev_alert(hw->card->dev, "PLL initialization failed!!!\n");
...@@ -1407,7 +1407,7 @@ static int hw_reset_dac(struct hw *hw) ...@@ -1407,7 +1407,7 @@ static int hw_reset_dac(struct hw *hw)
/* To be effective, need to reset the DAC twice. */ /* To be effective, need to reset the DAC twice. */
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
/* set gpio */ /* set gpio */
mdelay(100); msleep(100);
gpioorg = (u16)hw_read_20kx(hw, GPIO); gpioorg = (u16)hw_read_20kx(hw, GPIO);
gpioorg &= 0xfffd; gpioorg &= 0xfffd;
hw_write_20kx(hw, GPIO, gpioorg); hw_write_20kx(hw, GPIO, gpioorg);
...@@ -2030,7 +2030,7 @@ static int hw_card_init(struct hw *hw, struct card_conf *info) ...@@ -2030,7 +2030,7 @@ static int hw_card_init(struct hw *hw, struct card_conf *info)
hw_write_20kx(hw, GIE, 0); hw_write_20kx(hw, GIE, 0);
/* Reset all SRC pending interrupts */ /* Reset all SRC pending interrupts */
hw_write_20kx(hw, SRCIP, 0); hw_write_20kx(hw, SRCIP, 0);
mdelay(30); msleep(30);
/* Detect the card ID and configure GPIO accordingly. */ /* Detect the card ID and configure GPIO accordingly. */
switch (hw->model) { switch (hw->model) {
......
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