]>
Commit | Line | Data |
---|---|---|
8b92fd39 GKH |
1 | From a6dd114e16cbc4410049a90a8a67b967333d108d Mon Sep 17 00:00:00 2001 |
2 | From: Wei Yongjun <yongjun_wei@trendmicro.com.cn> | |
3 | Date: Sun, 2 Dec 2012 05:10:44 -0500 | |
4 | Subject: tty: serial: vt8500: fix return value check in vt8500_serial_probe() | |
5 | ||
6 | From: Wei Yongjun <yongjun_wei@trendmicro.com.cn> | |
7 | ||
8 | commit a6dd114e16cbc4410049a90a8a67b967333d108d upstream. | |
9 | ||
10 | In case of error, function of_clk_get() returns ERR_PTR() | |
11 | and never returns NULL. The NULL test in the return value | |
12 | check should be replaced with IS_ERR(). | |
13 | ||
14 | Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> | |
15 | Acked-by: Tony Prisk <linux@prisktech.co.nz> | |
16 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
17 | ||
18 | --- | |
19 | drivers/tty/serial/vt8500_serial.c | 2 +- | |
20 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
21 | ||
22 | --- a/drivers/tty/serial/vt8500_serial.c | |
23 | +++ b/drivers/tty/serial/vt8500_serial.c | |
24 | @@ -604,7 +604,7 @@ static int __devinit vt8500_serial_probe | |
25 | vt8500_port->uart.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF; | |
26 | ||
27 | vt8500_port->clk = of_clk_get(pdev->dev.of_node, 0); | |
28 | - if (vt8500_port->clk) { | |
29 | + if (!IS_ERR(vt8500_port->clk)) { | |
30 | vt8500_port->uart.uartclk = clk_get_rate(vt8500_port->clk); | |
31 | } else { | |
32 | /* use the default of 24Mhz if not specified and warn */ |