]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
spi: Replace custom fsleep() implementation
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 5 Feb 2025 13:06:24 +0000 (15:06 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 5 Feb 2025 13:53:10 +0000 (13:53 +0000)
_spi_transfer_delay_ns() partially reimplements what fsleep() does.
Replace that code by calling fsleep() instead.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20250205130624.716039-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c

index a7a4647717d44e4983f7d6725d17e7321d59506d..68e6758771681bf272314a76b4b600f48e37f7c5 100644 (file)
@@ -1495,10 +1495,7 @@ static void _spi_transfer_delay_ns(u32 ns)
        } else {
                u32 us = DIV_ROUND_UP(ns, NSEC_PER_USEC);
 
-               if (us <= 10)
-                       udelay(us);
-               else
-                       usleep_range(us, us + DIV_ROUND_UP(us, 10));
+               fsleep(us);
        }
 }