[bootlin/training-materials updates] master: kernel-serial-interrupt: Reword the instructions about the IRQ (b23eef30)

Miquel Raynal miquel.raynal at bootlin.com
Fri Sep 17 18:57:54 CEST 2021


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

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

commit b23eef3017f59bfab1526f91ad33f59b741f3828
Author: Miquel Raynal <miquel.raynal at bootlin.com>
Date:   Fri Sep 17 18:48:08 2021 +0200

    kernel-serial-interrupt: Reword the instructions about the IRQ
    
    No need to save the IRQ number, we only use it in the probe.
    Drop the variable from the main structure.
    
    Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>


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

b23eef3017f59bfab1526f91ad33f59b741f3828
 labs/kernel-serial-interrupt/kernel-serial-interrupt.tex | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/labs/kernel-serial-interrupt/kernel-serial-interrupt.tex b/labs/kernel-serial-interrupt/kernel-serial-interrupt.tex
index 126a356a..8811e8e9 100644
--- a/labs/kernel-serial-interrupt/kernel-serial-interrupt.tex
+++ b/labs/kernel-serial-interrupt/kernel-serial-interrupt.tex
@@ -31,20 +31,11 @@ hardware interrupt number. This virtual number is created through the
 \code{irqdomain} mechanism. The hardware IRQ number to use is found in
 the device tree.
 
-First, add an \code{irq} field to your \code{serial_dev} structure:
+First, retrieve the unique IRQ number to request:
 
 \begin{verbatim}
-struct serial_dev {
-        struct miscdevice miscdev;
-        void __iomem *regs;
-        int irq;
-};
-\end{verbatim}
-
-Now, to retrieve the IRQ number to be used with \kfunc{devm_request_irq}:
-
-\begin{verbatim}
-serial->irq = platform_get_irq(pdev, 0);
+int irq;
+irq = platform_get_irq(pdev, 0);
 \end{verbatim}
 
 Then, pass the interrupt number to \kfunc{devm_request_irq} along
@@ -107,7 +98,6 @@ we can read from:
 struct serial_dev {
         void __iomem *regs;
         struct miscdevice miscdev;
-        int irq;
         char buf[SERIAL_BUFSIZE];
         unsigned int buf_rd;
         unsigned int buf_wr;




More information about the training-materials-updates mailing list