summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2016-09-10 14:22:17 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-09-13 18:54:34 +0200
commit0d2665b6bcfd6b7df828582a0b8a12d29691b66d (patch)
treec29b562ddda5c3731c006414af449d26b9de6754 /drivers/tty
parentserial: mxs-auart: Disable clock on error path (diff)
downloadlinux-0d2665b6bcfd6b7df828582a0b8a12d29691b66d.tar.xz
linux-0d2665b6bcfd6b7df828582a0b8a12d29691b66d.zip
serial: mxs-auart: Use PTR_ERR_OR_ZERO() to simplify the code
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR. Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/mxs-auart.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index 680270b85ff7..ec0ab33efd9d 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -1510,10 +1510,7 @@ static int mxs_get_clks(struct mxs_auart_port *s,
if (!is_asm9260_auart(s)) {
s->clk = devm_clk_get(&pdev->dev, NULL);
- if (IS_ERR(s->clk))
- return PTR_ERR(s->clk);
-
- return 0;
+ return PTR_ERR_OR_ZERO(s->clk);
}
s->clk = devm_clk_get(s->dev, "mod");