devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tty: serial: vt8500: fix return value check in vt8500_serial_probe()
@ 2012-12-02 10:10 Wei Yongjun
  2012-12-02 17:47 ` Tony Prisk
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2012-12-02 10:10 UTC (permalink / raw)
  To: linux, alan, gregkh, grant.likely, rob.herring
  Cc: yongjun_wei, linux-arm-kernel, linux-serial, devicetree-discuss

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

In case of error, function of_clk_get() returns ERR_PTR()
and never returns NULL. The NULL test in the return value
check should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/tty/serial/vt8500_serial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/vt8500_serial.c b/drivers/tty/serial/vt8500_serial.c
index 205d4cf..f528cc2 100644
--- a/drivers/tty/serial/vt8500_serial.c
+++ b/drivers/tty/serial/vt8500_serial.c
@@ -604,7 +604,7 @@ static int __devinit vt8500_serial_probe(struct platform_device *pdev)
 	vt8500_port->uart.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF;
 
 	vt8500_port->clk = of_clk_get(pdev->dev.of_node, 0);
-	if (vt8500_port->clk) {
+	if (!IS_ERR(vt8500_port->clk)) {
 		vt8500_port->uart.uartclk = clk_get_rate(vt8500_port->clk);
 	} else {
 		/* use the default of 24Mhz if not specified and warn */



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-12-02 17:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-02 10:10 [PATCH] tty: serial: vt8500: fix return value check in vt8500_serial_probe() Wei Yongjun
2012-12-02 17:47 ` Tony Prisk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).