From owner-svn-src-stable@FreeBSD.ORG Fri Jun 14 20:44:24 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3BDBE6C6; Fri, 14 Jun 2013 20:44:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2D8241820; Fri, 14 Jun 2013 20:44:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5EKiOO5068472; Fri, 14 Jun 2013 20:44:24 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5EKiOPD068471; Fri, 14 Jun 2013 20:44:24 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201306142044.r5EKiOPD068471@svn.freebsd.org> From: John Baldwin Date: Fri, 14 Jun 2013 20:44:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251760 - stable/8/sys/dev/acpi_support X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jun 2013 20:44:24 -0000 Author: jhb Date: Fri Jun 14 20:44:23 2013 New Revision: 251760 URL: http://svnweb.freebsd.org/changeset/base/251760 Log: MFC 250053: Only cleanup CMI-related state on detach if the system supports CMI. Modified: stable/8/sys/dev/acpi_support/acpi_hp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/acpi_support/ (props changed) Modified: stable/8/sys/dev/acpi_support/acpi_hp.c ============================================================================== --- stable/8/sys/dev/acpi_support/acpi_hp.c Fri Jun 14 20:32:33 2013 (r251759) +++ stable/8/sys/dev/acpi_support/acpi_hp.c Fri Jun 14 20:44:23 2013 (r251760) @@ -573,28 +573,26 @@ acpi_hp_attach(device_t dev) static int acpi_hp_detach(device_t dev) { - int ret; + struct acpi_hp_softc *sc; ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); - struct acpi_hp_softc *sc = device_get_softc(dev); - if (sc->has_cmi && sc->hpcmi_open_pid != 0) { - ret = EBUSY; - } - else { - if (sc->has_notify) { - ACPI_WMI_REMOVE_EVENT_HANDLER(dev, - ACPI_HP_WMI_EVENT_GUID); - } + sc = device_get_softc(dev); + if (sc->has_cmi && sc->hpcmi_open_pid != 0) + return (EBUSY); + + if (sc->has_notify) + ACPI_WMI_REMOVE_EVENT_HANDLER(dev, ACPI_HP_WMI_EVENT_GUID); + + if (sc->has_cmi) { if (sc->hpcmi_bufptr != -1) { sbuf_delete(&sc->hpcmi_sbuf); sc->hpcmi_bufptr = -1; } sc->hpcmi_open_pid = 0; destroy_dev(sc->hpcmi_dev_t); - ret = 0; } - return (ret); + return (0); } static int