]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
usb: xhci-mtk: fix ptr_ret.cocci warnings
authorkbuild test robot <fengguang.wu@intel.com>
Tue, 24 Oct 2017 16:33:18 +0000 (00:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Oct 2017 06:54:33 +0000 (08:54 +0200)
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")
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-mtk.c

index e5caabe7eebed4ff67aaf3467aefe055141e6ef6..19d27ce31fdc807ea771f98703ec8dc0fd94f6ce 100644 (file)
@@ -253,10 +253,7 @@ static int xhci_mtk_clks_get(struct xhci_hcd_mtk *mtk)
                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)