Skip to contentSkip to conversation

usb: host: xhci-plat: Remove useless test before clk_disable_unprepare

PATCH New Mathias Nyman 1 participant 1 message Apr 20, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/3 usb: host: xhci-plat: Remove useless test before clk_disable_unprepare

From: Gregory CLEMENT <[email protected]>

clk_disable_unprepare() already checks that the clock pointer is valid. No need to test it before calling it.

---
 drivers/usb/host/xhci-plat.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/usb/host/xhci-plat.c +2 -4
index df327dc..f0231fe 100644
@@ -320,8 +320,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
 	usb_put_hcd(xhci->shared_hcd);
 
 disable_clk:
-	if (!IS_ERR(clk))
-		clk_disable_unprepare(clk);
+	clk_disable_unprepare(clk);
 
 put_hcd:
 	usb_put_hcd(hcd);
@@ -347,8 +346,7 @@ static int xhci_plat_remove(struct platform_device *dev)
 	usb_remove_hcd(hcd);
 	usb_put_hcd(xhci->shared_hcd);
 
-	if (!IS_ERR(clk))
-		clk_disable_unprepare(clk);
+	clk_disable_unprepare(clk);
 	usb_put_hcd(hcd);
 
 	pm_runtime_set_suspended(&dev->dev);