Skip to content

Commit

Permalink
tty: serial: vt8500: fix return value check in vt8500_serial_probe()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Tony Prisk <[email protected]>
Cc: stable <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Wei Yongjun authored and gregkh committed Jan 16, 2013
1 parent 87b8bed commit a6dd114
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/tty/serial/vt8500_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ static int 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 */
Expand Down

0 comments on commit a6dd114

Please sign in to comment.