Skip to content

Commit

Permalink
linux: serial: Use proper types and fix a copy/paste error
Browse files Browse the repository at this point in the history
While at updating the prototypes in the lab book, fix the reg_read() definition
which should return something anyway.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
  • Loading branch information
miquelraynal authored and tpetazzoni committed Oct 29, 2021
1 parent 7faf8cc commit d616547
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions labs/kernel-serial-iomem/kernel-serial-iomem.tex
Expand Up @@ -153,7 +153,7 @@ \subsection{Accessing device registers}

Your prototype should look like:
\begin{verbatim}
static void reg_read(struct serial_dev *serial, int reg);
static u32 reg_read(struct serial_dev *serial, unsigned int reg);
\end{verbatim}

In this function, read from a 32 bits register at the base virtual
Expand All @@ -170,7 +170,7 @@ \subsection{Accessing device registers}
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 *serial, int val, int reg);
static void reg_write(struct serial_dev *serial, u32 val, unsigned int reg);
\end{verbatim}

In the next sections, we will tell you what register offsets to use
Expand Down

0 comments on commit d616547

Please sign in to comment.