From owner-svn-src-all@freebsd.org Fri Dec 9 20:03:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A32CC6F3F8; Fri, 9 Dec 2016 20:03:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 598A8A12; Fri, 9 Dec 2016 20:03:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB9K3nUF040360; Fri, 9 Dec 2016 20:03:49 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9K3n8w040359; Fri, 9 Dec 2016 20:03:49 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201612092003.uB9K3n8w040359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 9 Dec 2016 20:03:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309755 - stable/11/sys/arm/allwinner X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 20:03:50 -0000 Author: manu Date: Fri Dec 9 20:03:49 2016 New Revision: 309755 URL: https://svnweb.freebsd.org/changeset/base/309755 Log: MFC r309029: Do not attempt to disable/release clock if it had not been enabled. While here fix a style(9) issue. Modified: stable/11/sys/arm/allwinner/a10_ehci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/allwinner/a10_ehci.c ============================================================================== --- stable/11/sys/arm/allwinner/a10_ehci.c Fri Dec 9 19:40:33 2016 (r309754) +++ stable/11/sys/arm/allwinner/a10_ehci.c Fri Dec 9 20:03:49 2016 (r309755) @@ -266,8 +266,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); } @@ -328,8 +330,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) {