[bootlin/training-materials updates] master: linux: serial-lab: Rename the main structure name (7faf8ccc)
Thomas Petazzoni
thomas.petazzoni at bootlin.com
Fri Oct 29 10:46:37 CEST 2021
Repository : https://github.com/bootlin/training-materials
On branch : master
Link : https://github.com/bootlin/training-materials/commit/7faf8cccb692c5d8b6e1e6a51dc43ae44579e2ae
>---------------------------------------------------------------
commit 7faf8cccb692c5d8b6e1e6a51dc43ae44579e2ae
Author: Miquel Raynal <miquel.raynal at bootlin.com>
Date: Wed May 5 23:05:39 2021 +0200
linux: serial-lab: Rename the main structure name
It is probably better to call this structure serial than dev to avoid confusion
with the device structure of the device model.
Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>
>---------------------------------------------------------------
7faf8cccb692c5d8b6e1e6a51dc43ae44579e2ae
labs/kernel-serial-iomem/kernel-serial-iomem.tex | 4 ++--
labs/kernel-serial-iomem/uart-line-init.c | 12 ++++++------
labs/kernel-serial-iomem/uart-line-reset.c | 4 ++--
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/labs/kernel-serial-iomem/kernel-serial-iomem.tex b/labs/kernel-serial-iomem/kernel-serial-iomem.tex
index f2d76997..f2bdd3c4 100644
--- a/labs/kernel-serial-iomem/kernel-serial-iomem.tex
+++ b/labs/kernel-serial-iomem/kernel-serial-iomem.tex
@@ -153,7 +153,7 @@ offset.
Your prototype should look like:
\begin{verbatim}
-static void reg_read(struct serial_dev *dev, int reg);
+static void reg_read(struct serial_dev *serial, int reg);
\end{verbatim}
In this function, read from a 32 bits register at the base virtual
@@ -170,7 +170,7 @@ the device base virtual address. The following code samples are using
the \kfunc{writel} convention of passing the value first, then the
offset. Your prototype should look like:
\begin{verbatim}
-static void reg_write(struct serial_dev *dev, int val, int reg);
+static void reg_write(struct serial_dev *serial, int val, int reg);
\end{verbatim}
In the next sections, we will tell you what register offsets to use
diff --git a/labs/kernel-serial-iomem/uart-line-init.c b/labs/kernel-serial-iomem/uart-line-init.c
index ae6bf246..9b181e51 100644
--- a/labs/kernel-serial-iomem/uart-line-init.c
+++ b/labs/kernel-serial-iomem/uart-line-init.c
@@ -3,9 +3,9 @@
of_property_read_u32(pdev->dev.of_node, "clock-frequency",
&uartclk);
baud_divisor = uartclk / 16 / 115200;
-reg_write(dev, 0x07, UART_OMAP_MDR1);
-reg_write(dev, 0x00, UART_LCR);
-reg_write(dev, UART_LCR_DLAB, UART_LCR);
-reg_write(dev, baud_divisor & 0xff, UART_DLL);
-reg_write(dev, (baud_divisor >> 8) & 0xff, UART_DLM);
-reg_write(dev, UART_LCR_WLEN8, UART_LCR);
+reg_write(serial, 0x07, UART_OMAP_MDR1);
+reg_write(serial, 0x00, UART_LCR);
+reg_write(serial, UART_LCR_DLAB, UART_LCR);
+reg_write(serial, baud_divisor & 0xff, UART_DLL);
+reg_write(serial, (baud_divisor >> 8) & 0xff, UART_DLM);
+reg_write(serial, UART_LCR_WLEN8, UART_LCR);
diff --git a/labs/kernel-serial-iomem/uart-line-reset.c b/labs/kernel-serial-iomem/uart-line-reset.c
index 753bdd18..93e025e6 100644
--- a/labs/kernel-serial-iomem/uart-line-reset.c
+++ b/labs/kernel-serial-iomem/uart-line-reset.c
@@ -1,3 +1,3 @@
/* Soft reset */
-reg_write(dev, UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT, UART_FCR);
-reg_write(dev, 0x00, UART_OMAP_MDR1);
+reg_write(serial, UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT, UART_FCR);
+reg_write(serial, 0x00, UART_OMAP_MDR1);
More information about the training-materials-updates
mailing list