diff options
author | Jia-Ju Bai <baijiaju1990@gmail.com> | 2018-07-27 04:57:56 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-07-27 05:48:50 -0400 |
commit | 08fd8325d94eeddfe49ef8191337e5f54553f6b0 (patch) | |
tree | cf3061c62b493b7c4f55021783a5cefe158f3138 | |
parent | df3f0347fd856272ca9fdbb6e691b7b512b7acb4 (diff) |
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: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/ctxfi/cthw20k1.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/pci/ctxfi/cthw20k1.c b/sound/pci/ctxfi/cthw20k1.c index 8e6eb9d7984b..6a051a1c3724 100644 --- a/sound/pci/ctxfi/cthw20k1.c +++ b/sound/pci/ctxfi/cthw20k1.c | |||
@@ -1319,7 +1319,7 @@ static int hw_pll_init(struct hw *hw, unsigned int rsr) | |||
1319 | break; | 1319 | break; |
1320 | 1320 | ||
1321 | hw_write_20kx(hw, PLLCTL, pllctl); | 1321 | hw_write_20kx(hw, PLLCTL, pllctl); |
1322 | mdelay(40); | 1322 | msleep(40); |
1323 | } | 1323 | } |
1324 | if (i >= 3) { | 1324 | if (i >= 3) { |
1325 | dev_alert(hw->card->dev, "PLL initialization failed!!!\n"); | 1325 | dev_alert(hw->card->dev, "PLL initialization failed!!!\n"); |
@@ -1407,7 +1407,7 @@ static int hw_reset_dac(struct hw *hw) | |||
1407 | /* To be effective, need to reset the DAC twice. */ | 1407 | /* To be effective, need to reset the DAC twice. */ |
1408 | for (i = 0; i < 2; i++) { | 1408 | for (i = 0; i < 2; i++) { |
1409 | /* set gpio */ | 1409 | /* set gpio */ |
1410 | mdelay(100); | 1410 | msleep(100); |
1411 | gpioorg = (u16)hw_read_20kx(hw, GPIO); | 1411 | gpioorg = (u16)hw_read_20kx(hw, GPIO); |
1412 | gpioorg &= 0xfffd; | 1412 | gpioorg &= 0xfffd; |
1413 | hw_write_20kx(hw, GPIO, gpioorg); | 1413 | hw_write_20kx(hw, GPIO, gpioorg); |
@@ -2030,7 +2030,7 @@ static int hw_card_init(struct hw *hw, struct card_conf *info) | |||
2030 | hw_write_20kx(hw, GIE, 0); | 2030 | hw_write_20kx(hw, GIE, 0); |
2031 | /* Reset all SRC pending interrupts */ | 2031 | /* Reset all SRC pending interrupts */ |
2032 | hw_write_20kx(hw, SRCIP, 0); | 2032 | hw_write_20kx(hw, SRCIP, 0); |
2033 | mdelay(30); | 2033 | msleep(30); |
2034 | 2034 | ||
2035 | /* Detect the card ID and configure GPIO accordingly. */ | 2035 | /* Detect the card ID and configure GPIO accordingly. */ |
2036 | switch (hw->model) { | 2036 | switch (hw->model) { |