[FE training-materials-updates] kernel-serial-interrupt: use platform_get_irq()

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Wed Jul 16 15:22:41 CEST 2014

Repository : git://git.free-electrons.com/training-materials.git

On branch  : master
Link       : http://git.free-electrons.com/training-materials/commit/?id=c9fe6a1211c9a73ff66a43be3ddcb4f389840e29


commit c9fe6a1211c9a73ff66a43be3ddcb4f389840e29
Author: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
Date:   Wed Jul 16 15:22:08 2014 +0200

    kernel-serial-interrupt: use platform_get_irq()
    Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>


 .../kernel-serial-interrupt.tex                    |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/labs/kernel-serial-interrupt/kernel-serial-interrupt.tex b/labs/kernel-serial-interrupt/kernel-serial-interrupt.tex
index 36ed8c2..aa1f8fa 100644
--- a/labs/kernel-serial-interrupt/kernel-serial-interrupt.tex
+++ b/labs/kernel-serial-interrupt/kernel-serial-interrupt.tex
@@ -41,16 +41,14 @@ struct feserial_dev {
-Now, there is a very convenient shortcut to retrieve the
-hardware IRQ number from the device tree and get a virtual IRQ number.
+Now, to retrieve the IRQ number to be used with \code{request_irq()} :
-dev->irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
+dev->irq = platform_get_irq(pdev, 0);
-Then, pass the newly created virtual interrupt to \code{devm_request_irq()}
-along with the interrupt handler to register your interrupt in the
+Then, pass the interrupt number to \code{devm_request_irq()} along
+with the interrupt handler to register your interrupt in the kernel.
 Then, in the interrupt handler, just print a message and return
 \code{IRQ_HANDLED} (to tell the kernel that we have handled the

More information about the training-materials-updates mailing list