svn commit: r251759 - stable/9/sys/dev/acpi_support
John Baldwin
jhb at FreeBSD.org
Fri Jun 14 20:32:33 UTC 2013
Author: jhb
Date: Fri Jun 14 20:32:33 2013
New Revision: 251759
URL: http://svnweb.freebsd.org/changeset/base/251759
Log:
MFC 250053:
Only cleanup CMI-related state on detach if the system supports CMI.
Modified:
stable/9/sys/dev/acpi_support/acpi_hp.c
Directory Properties:
stable/9/sys/ (props changed)
stable/9/sys/dev/ (props changed)
Modified: stable/9/sys/dev/acpi_support/acpi_hp.c
==============================================================================
--- stable/9/sys/dev/acpi_support/acpi_hp.c Fri Jun 14 19:35:30 2013 (r251758)
+++ stable/9/sys/dev/acpi_support/acpi_hp.c Fri Jun 14 20:32:33 2013 (r251759)
@@ -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
More information about the svn-src-stable-9
mailing list