staging: ks7010: Replace mdelay with usleep_range in ks7010_upload_firmware
authorJia-Ju Bai <baijiaju1990@gmail.com>
Tue, 10 Apr 2018 08:58:54 +0000 (16:58 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Apr 2018 12:24:47 +0000 (14:24 +0200)
commit95751f19b6942680f2884b44a127490c91aa4291
tree8b3c6c9d5a94e31afa545229274424a2ccfec22d
parent47bda74a2b1978f0740fdd025dc7b44c026764a8
staging: ks7010: Replace mdelay with usleep_range in ks7010_upload_firmware

ks7010_upload_firmware() is never called in atomic context.

The call chain ending up at ks7010_upload_firmware() is:
[1] ks7010_upload_firmware() <- ks7010_sdio_probe()

ks7010_sdio_probe() is set as ".probe" in struct sdio_driver.
This function is not called in atomic context.

Despite never getting called from atomic context, ks7010_upload_firmware()
calls mdelay() to busily 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.
And I also manually check it.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks7010_sdio.c