]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
bcma: Replace mdelay with usleep_range in bcma_pmu_resources_init
authorJia-Ju Bai <baijiaju1990@gmail.com>
Fri, 26 Jan 2018 16:38:35 +0000 (00:38 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 27 Feb 2018 13:52:13 +0000 (15:52 +0200)
After checking all possible call chains to bcma_pmu_resources_init() here,
my tool finds that this function is never called in atomic context,
namely never in an interrupt handler or holding a spinlock.
Thus mdelay can be replaced with usleep_range to avoid busy wait.

This is found by a static analysis tool named DCNS written by myself.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/bcma/driver_chipcommon_pmu.c

index f1eb4d3e1d575b2806c3d43155efb85f7640228d..f4161064365c9763bfe6e7741ac64538624cecd8 100644 (file)
@@ -203,7 +203,7 @@ static void bcma_pmu_resources_init(struct bcma_drv_cc *cc)
         * Add some delay; allow resources to come up and settle.
         * Delay is required for SoC (early init).
         */
-       mdelay(2);
+       usleep_range(2000, 2500);
 }
 
 /* Disable to allow reading SPROM. Don't know the adventages of enabling it. */