From: Jia-Ju Bai Date: Fri, 26 Jan 2018 16:38:35 +0000 (+0800) Subject: bcma: Replace mdelay with usleep_range in bcma_pmu_resources_init X-Git-Tag: v4.17-rc1~148^2~101^2~61 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8100091d02487ff267af0d410ceb9eefebc8ea03;p=thirdparty%2Fkernel%2Flinux.git bcma: Replace mdelay with usleep_range in bcma_pmu_resources_init 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 Acked-by: Larry Finger Signed-off-by: Kalle Valo --- diff --git a/drivers/bcma/driver_chipcommon_pmu.c b/drivers/bcma/driver_chipcommon_pmu.c index f1eb4d3e1d575..f4161064365c9 100644 --- a/drivers/bcma/driver_chipcommon_pmu.c +++ b/drivers/bcma/driver_chipcommon_pmu.c @@ -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. */