rk_fiq_debugger: remove "read signal irq from dts directly"
authorHuibin Hong <huibin.hong@rock-chips.com>
Thu, 4 May 2017 13:33:37 +0000 (21:33 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 8 May 2017 03:12:28 +0000 (11:12 +0800)
Change-Id: I1f531ce2f58b33d5501f8446ad393e7ac4f27ef0
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
drivers/soc/rockchip/rk_fiq_debugger.c

index d8777bcf3d71a439309990b7c8c6017c9893b12c..db1e784eea115271a7626bf9d867dc17899a7544 100755 (executable)
@@ -544,7 +544,7 @@ static int __init rk_fiq_debugger_init(void) {
        void __iomem *base;
        struct device_node *np;
        unsigned int id, ok = 0;
-       int irq, signal_irq = 0, wake_irq = 0;
+       int irq, signal_irq = -1, wake_irq = -1;
        unsigned int baudrate = 0, irq_mode = 0;
        phys_addr_t phy_base = 0;
        int serial_id;
@@ -571,10 +571,13 @@ static int __init rk_fiq_debugger_init(void) {
        if (of_property_read_u32(np, "rockchip,irq-mode-enable", &irq_mode))
                irq_mode = -1;
 
-       if (irq_mode == 1)
-               signal_irq = -1;
-       else if (of_property_read_u32(np, "rockchip,signal-irq", &signal_irq))
+       if (irq_mode == 1) {
                signal_irq = -1;
+       } else {
+               signal_irq = irq_of_parse_and_map(np, 0);
+               if (!signal_irq)
+                       return -EINVAL;
+       }
 
        if (of_property_read_u32(np, "rockchip,wake-irq", &wake_irq))
                wake_irq = -1;
@@ -582,12 +585,6 @@ static int __init rk_fiq_debugger_init(void) {
        if (of_property_read_u32(np, "rockchip,baudrate", &baudrate))
                baudrate = -1;
 
-       if (signal_irq > 0) {
-               signal_irq = irq_of_parse_and_map(np, 0);
-               if (!signal_irq)
-                       return -EINVAL;
-       }
-
        np = NULL;
 
        do {