tty: serial: 8250_mtk: Use PTR_ERR_OR_ZERO
authorHimanshu Jha <himanshujha199640@gmail.com>
Sun, 27 Aug 2017 06:31:41 +0000 (12:01 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Aug 2017 18:51:20 +0000 (20:51 +0200)
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_mtk.c

index ce0cc471bfc3c6cb6b314327705e62e4634fa471..fb45770d47aa2adb4166c5b58564e1cad3718acc 100644 (file)
@@ -171,10 +171,7 @@ static int mtk8250_probe_of(struct platform_device *pdev, struct uart_port *p,
        }
 
        data->bus_clk = devm_clk_get(&pdev->dev, "bus");
-       if (IS_ERR(data->bus_clk))
-               return PTR_ERR(data->bus_clk);
-
-       return 0;
+       return PTR_ERR_OR_ZERO(data->bus_clk);
 }
 
 static int mtk8250_probe(struct platform_device *pdev)