mtd: rawnand: diskonchip: Replace mdelay with usleep_range in doc_probe
authorJia-Ju Bai <baijiaju1990@gmail.com>
Wed, 11 Apr 2018 02:57:57 +0000 (10:57 +0800)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Sun, 29 Apr 2018 06:56:41 +0000 (08:56 +0200)
commit7b4b199459f31541141c4510e542bd4533a60585
tree76068d82b6e888b8ff7623d058d2b7f647f4e27f
parentddd5ed3a90e797e2015cd83e9697c6ed867a3891
mtd: rawnand: diskonchip: Replace mdelay with usleep_range in doc_probe

doc_probe() is never called in atomic context.

doc_probe() is only called by init_nanddoc(), which is only set as
a parameter of module_init().
This function is not called in atomic context.

Despite never getting called from atomic context, doc_probe()
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: Boris Brezillon <boris.brezillon@bootlin.com>
drivers/mtd/nand/raw/diskonchip.c