Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: wfx: use more power-efficient sleep for reset

Replace udelay() with usleep_range() as all uses are in a sleepable context.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Link: https://lore.kernel.org/r/59e1e4e5bd80c1879ef36eaa59916e47005dbb04.1581416843.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Michał Mirosław and committed by
Greg Kroah-Hartman
d2bdc492 40a97d55

+4 -4
+1 -1
drivers/staging/wfx/bh.c
··· 26 26 gpiod_set_value_cansleep(wdev->pdata.gpio_wakeup, 1); 27 27 if (wfx_api_older_than(wdev, 1, 4)) { 28 28 if (!completion_done(&wdev->hif.ctrl_ready)) 29 - udelay(2000); 29 + usleep_range(2000, 2500); 30 30 } else { 31 31 // completion.h does not provide any function to wait 32 32 // completion without consume it (a kind of
+2 -2
drivers/staging/wfx/bus_spi.c
··· 211 211 if (spi_get_device_id(func)->driver_data & WFX_RESET_INVERTED) 212 212 gpiod_toggle_active_low(bus->gpio_reset); 213 213 gpiod_set_value_cansleep(bus->gpio_reset, 1); 214 - udelay(100); 214 + usleep_range(100, 150); 215 215 gpiod_set_value_cansleep(bus->gpio_reset, 0); 216 - udelay(2000); 216 + usleep_range(2000, 2500); 217 217 } 218 218 219 219 INIT_WORK(&bus->request_rx, wfx_spi_request_rx);
+1 -1
drivers/staging/wfx/hwio.c
··· 142 142 goto err; 143 143 if (!(cfg & prefetch)) 144 144 break; 145 - udelay(200); 145 + usleep_range(200, 250); 146 146 } 147 147 if (i == 20) { 148 148 ret = -ETIMEDOUT;