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

Thomas Petazzoni thomas.petazzoni at bootlin.com
Fri Oct 29 10:46:40 CEST 2021

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


commit d5ab64aff19ab884c0371d64d7d1fe6aed1576fe
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>


 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:
-struct serial_dev {
-        struct miscdevice miscdev;
-        void __iomem *regs;
-        int irq;
-Now, to retrieve the IRQ number to be used with \kfunc{devm_request_irq}:
-serial->irq = platform_get_irq(pdev, 0);
+int irq;
+irq = platform_get_irq(pdev, 0);
 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