From: 黄涛 Date: Fri, 13 Dec 2013 08:40:30 +0000 (+0800) Subject: rk_serial: use of_alias_get_id to get serial id X-Git-Tag: firefly_0821_release~6448 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=280d558b93a35e6544949f31420557e28c729a81;p=firefly-linux-kernel-4.4.55.git rk_serial: use of_alias_get_id to get serial id --- diff --git a/arch/arm/boot/dts/rk3188.dtsi b/arch/arm/boot/dts/rk3188.dtsi index 3f1214b7b6f4..e2d7fdae238c 100755 --- a/arch/arm/boot/dts/rk3188.dtsi +++ b/arch/arm/boot/dts/rk3188.dtsi @@ -7,6 +7,13 @@ compatible = "rockchip,rk3188"; interrupt-parent = <&gic>; + aliases { + serial0 = &uart0; + serial1 = &uart1; + serial2 = &uart2; + serial3 = &uart3; + }; + cpus { #address-cells = <1>; #size-cells = <0>; @@ -172,7 +179,6 @@ interrupts = ; }; - uart0: serial@10124000 { compatible = "rockchip,serial"; reg = <0x10124000 0x100>; @@ -180,7 +186,6 @@ clock-frequency = <24000000>; reg-shift = <2>; reg-io-width = <4>; - id = <0>; pinctrl-names = "default"; pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>; status = "disabled"; @@ -193,7 +198,6 @@ clock-frequency = <24000000>; reg-shift = <2>; reg-io-width = <4>; - id = <1>; pinctrl-names = "default"; pinctrl-0 = <&uart1_xfer &uart1_cts &uart1_rts>; status = "disabled"; @@ -207,7 +211,6 @@ current-speed = <115200>; reg-shift = <2>; reg-io-width = <4>; - id = <2>; pinctrl-names = "default"; pinctrl-0 = <&uart2_xfer>; status = "disabled"; @@ -220,7 +223,6 @@ clock-frequency = <24000000>; reg-shift = <2>; reg-io-width = <4>; - id = <3>; pinctrl-names = "default"; pinctrl-0 = <&uart3_xfer &uart3_cts &uart3_rts>; status = "disabled"; diff --git a/arch/arm/mach-rockchip/rk_fiq_debugger.c b/arch/arm/mach-rockchip/rk_fiq_debugger.c index b8f37f221e95..f4d0de79d0e9 100644 --- a/arch/arm/mach-rockchip/rk_fiq_debugger.c +++ b/arch/arm/mach-rockchip/rk_fiq_debugger.c @@ -327,7 +327,8 @@ static int __init rk_fiq_debugger_init(void) { np = NULL; for (i = 0; i < 5; i++) { np = of_find_node_by_name(np, "serial"); - if (np && !of_property_read_u32(np, "id", &id)) { + if (np) { + id = of_alias_get_id(np, "serial"); if (id == serial_id) { ok = 1; break; diff --git a/drivers/tty/serial/rk_serial.c b/drivers/tty/serial/rk_serial.c index 561124349e38..3614ed9f74e2 100644 --- a/drivers/tty/serial/rk_serial.c +++ b/drivers/tty/serial/rk_serial.c @@ -1944,10 +1944,9 @@ static int serial_rk_remove_wakeup_irq(struct uart_rk_port *up) { #endif #ifdef CONFIG_OF -static int of_rk_serial_parse_dt(const struct device_node *np, struct of_rk_serial *rks) { +static int of_rk_serial_parse_dt(struct device_node *np, struct of_rk_serial *rks) { unsigned int val = 0; - if(!of_property_read_u32(np, "id", &val)) - rks->id = val; + rks->id = of_alias_get_id(np, "serial"); if(!of_property_read_u32(np, "clock-frequency", &val)) rks->uartclk = val; #if USE_DMA