Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Nov 2016 01:44:29 +0000 (UTC)
From:      Emmanuel Vadot <manu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r309029 - head/sys/arm/allwinner
Message-ID:  <201611230144.uAN1iTVY061649@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: manu
Date: Wed Nov 23 01:44:28 2016
New Revision: 309029
URL: https://svnweb.freebsd.org/changeset/base/309029

Log:
  Do not attempt to disable/release clock if it had not been enabled.
  While here fix a style(9) issue.
  
  MFC after:	1 week

Modified:
  head/sys/arm/allwinner/a10_ehci.c

Modified: head/sys/arm/allwinner/a10_ehci.c
==============================================================================
--- head/sys/arm/allwinner/a10_ehci.c	Wed Nov 23 00:26:31 2016	(r309028)
+++ head/sys/arm/allwinner/a10_ehci.c	Wed Nov 23 01:44:28 2016	(r309029)
@@ -263,8 +263,10 @@ a10_ehci_attach(device_t self)
 	return (0);
 
 error:
-	if (aw_sc->clk)
+	if (aw_sc->clk != NULL) {
+		clk_disable(aw_sc->clk);
 		clk_release(aw_sc->clk);
+	}
 	a10_ehci_detach(self);
 	return (ENXIO);
 }
@@ -325,8 +327,10 @@ a10_ehci_detach(device_t self)
 	A10_WRITE_4(sc, SW_USB_PMU_IRQ_ENABLE, reg_value);
 
 	/* Disable clock for USB */
-	clk_disable(aw_sc->clk);
-	clk_release(aw_sc->clk);
+	if (aw_sc->clk != NULL) {
+		clk_disable(aw_sc->clk);
+		clk_release(aw_sc->clk);
+	}
 
 	/* Assert reset */
 	if (aw_sc->rst != NULL) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611230144.uAN1iTVY061649>