diff options
author | Jia-Ju Bai <baijiaju1990@gmail.com> | 2018-04-10 15:36:40 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-04-22 15:49:42 +0200 |
commit | 0f0290089abd37ca54db764c294fe7e47624a313 (patch) | |
tree | e4cf7e610c3e62d48f959908e8739ab4882a1326 /drivers/usb/isp1760/isp1760-core.c | |
parent | 2a3dae10d51d262514498fe710c963da946ce6e2 (diff) | |
download | linux-0f0290089abd37ca54db764c294fe7e47624a313.tar.bz2 |
usb: isp1760: Replace mdelay with msleep in isp1760_init_core
isp1760_init_core() is never called in atomic context.
The call chains ending up at isp1760_init_core() are:
[1] isp1760_init_core() <- isp1760_register() <- isp1760_plat_probe()
[2] isp1760_init_core() <- isp1760_register() <- isp1761_pci_probe()
isp1760_plat_probe() is set as ".probe" in struct platform_driver.
isp1761_pci_probe() is set as ".probe" in struct pci_driver.
These functions are not called in atomic context.
Despite never getting called from atomic context, isp1761_pci_probe()
calls mdelay() to busily wait.
This is not necessary and can be replaced with msleep() 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>
Diffstat (limited to 'drivers/usb/isp1760/isp1760-core.c')
-rw-r--r-- | drivers/usb/isp1760/isp1760-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/isp1760/isp1760-core.c b/drivers/usb/isp1760/isp1760-core.c index 05d22589b5cc..55b94fd10331 100644 --- a/drivers/usb/isp1760/isp1760-core.c +++ b/drivers/usb/isp1760/isp1760-core.c @@ -31,7 +31,7 @@ static void isp1760_init_core(struct isp1760_device *isp) /* Low-level chip reset */ if (isp->rst_gpio) { gpiod_set_value_cansleep(isp->rst_gpio, 1); - mdelay(50); + msleep(50); gpiod_set_value_cansleep(isp->rst_gpio, 0); } |