platform: x86: intel_scu_ipc: Replace mdelay with usleep_range in intel_scu_ipc_i2c_cntrl
authorJia-Ju Bai <baijiaju1990@gmail.com>
Tue, 10 Apr 2018 12:57:56 +0000 (20:57 +0800)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 23 Apr 2018 14:24:23 +0000 (17:24 +0300)
commit8fddfb39a4791b3698e4e584681691567a276898
treec13813e5073bce6bdf18bc3ce6889252357cf5fb
parentde15b94f87d1e55c51e45127d761ebfab000232e
platform: x86: intel_scu_ipc: Replace mdelay with usleep_range in intel_scu_ipc_i2c_cntrl

intel_scu_ipc_i2c_cntrl() calls mutex_lock(), which indicates
this function is not called in atomic context.

Despite never getting called from atomic context,
intel_scu_ipc_i2c_cntrl() 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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/intel_scu_ipc.c