lkml.org 
[lkml]   [2017]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] usb: xhci-mtk: fix ptr_ret.cocci warnings
drivers/usb/host/xhci-mtk.c:256:1-3: WARNING: PTR_ERR_OR_ZERO can be used


Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

Fixes: b6bb72cf0df1 ("usb: xhci-mtk: add optional mcu and dma bus clocks")
CC: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

xhci-mtk.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -253,10 +253,7 @@ static int xhci_mtk_clks_get(struct xhci
return PTR_ERR(mtk->mcu_clk);

mtk->dma_clk = optional_clk_get(dev, "dma_ck");
- if (IS_ERR(mtk->dma_clk))
- return PTR_ERR(mtk->dma_clk);
-
- return 0;
+ return PTR_ERR_OR_ZERO(mtk->dma_clk);
}

static int xhci_mtk_clks_enable(struct xhci_hcd_mtk *mtk)
\
 
 \ /
  Last update: 2017-10-24 18:35    [W:0.431 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site