[bootlin/training-materials updates] master: labs/kernel-i2c-communication: use msleep, not usleep_range (bbba4b37)

Thomas Petazzoni thomas.petazzoni at bootlin.com
Tue Oct 13 17:53:44 CEST 2020


Repository : https://github.com/bootlin/training-materials
On branch  : master
Link       : https://github.com/bootlin/training-materials/commit/bbba4b3771b1d45ea5288b1eef4f732f41cc2e9b

>---------------------------------------------------------------

commit bbba4b3771b1d45ea5288b1eef4f732f41cc2e9b
Author: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
Date:   Tue Oct 13 17:53:15 2020 +0200

    labs/kernel-i2c-communication: use msleep, not usleep_range
    
    usleep_range(10, 20) is not sufficient to sleep 10ms, switch back to
    using msleep(10).
    
    Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>


>---------------------------------------------------------------

bbba4b3771b1d45ea5288b1eef4f732f41cc2e9b
 labs/kernel-i2c-communication/kernel-i2c-communication.tex | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/labs/kernel-i2c-communication/kernel-i2c-communication.tex b/labs/kernel-i2c-communication/kernel-i2c-communication.tex
index 48883bba..386178d1 100644
--- a/labs/kernel-i2c-communication/kernel-i2c-communication.tex
+++ b/labs/kernel-i2c-communication/kernel-i2c-communication.tex
@@ -257,12 +257,7 @@ In this function:
 
 \begin{enumerate}
 \item Start by putting a \code{10 ms} delay by calling
-      \code{usleep_range(10, 20)}, guaranteed to sleep between 10 and 20
-      ms.\footnote{That's better than using \kfunc{udelay} because it is not making
-      an active wait, and instead lets the CPU run other tasks in the meantime.
-      You'll find interesting details on how to sleep or wait in kernel
-      code for specified durations in the kernel documentation:
-      \kerneldochtml{timers/timers-howto}.}
+      \code{msleep(10)}.
       Such waiting time is needed to add time between the previous i2c
       operation and the next one.
 \item Write \code{0x00} to the bus. That will allow us to read




More information about the training-materials-updates mailing list