Skip to content

Commit

Permalink
serial: mxs-auart: Use PTR_ERR_OR_ZERO() to simplify the code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and Greg Kroah-Hartman committed Sep 13, 2016
1 parent 5d7519d commit 0d2665b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/tty/serial/mxs-auart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 0d2665b

Please sign in to comment.