ALSA: ad1889: Replace mdelay with usleep_range in snd_ad1889_init
authorJia-Ju Bai <baijiaju1990@gmail.com>
Mon, 9 Apr 2018 13:03:20 +0000 (21:03 +0800)
committerTakashi Iwai <tiwai@suse.de>
Mon, 16 Apr 2018 11:49:07 +0000 (13:49 +0200)
commit621fdf60ab22dd902d52a670e943371400b4ee20
tree9ba7bb1bcace8e45d0ac2b44962f64e5774c0263
parent0dc72fcc86e62632d0dbe8df39ed3e91e7f3fb4a
ALSA: ad1889: Replace mdelay with usleep_range in snd_ad1889_init

snd_ad1889_init() is never called in atomic context.

The call chain ending up at snd_ad1889_init() is:
[1] snd_ad1889_init() <- snd_ad1889_create() <- snd_ad1889_probe()

snd_ad1889_probe() is only set as ".probe" in struct pci_driver.
This function is not called in atomic context.

Despite never getting called from atomic context, snd_ad1889_init()
calls mdelay for busy wait.
This is not necessary and can be replaced with usleep_range to
avoid busy waiting.

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>
sound/pci/ad1889.c