Module Name:    src
Committed By:   riastradh
Date:           Wed Jul  2 19:49:38 UTC 2014

Modified Files:
        src/sys/dev/pci: ichsmb.c

Log Message:
Register a null pmf handler even if we failed to attach.

Keeps ichsmb(4) from preventing suspend even if it's broken because
of ichlpcib(4) grodiness.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/pci/ichsmb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ichsmb.c
diff -u src/sys/dev/pci/ichsmb.c:1.36 src/sys/dev/pci/ichsmb.c:1.37
--- src/sys/dev/pci/ichsmb.c:1.36	Mon Jun  9 08:52:43 2014
+++ src/sys/dev/pci/ichsmb.c	Wed Jul  2 19:49:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichsmb.c,v 1.36 2014/06/09 08:52:43 msaitoh Exp $	*/
+/*	$NetBSD: ichsmb.c,v 1.37 2014/07/02 19:49:38 riastradh Exp $	*/
 /*	$OpenBSD: ichiic.c,v 1.18 2007/05/03 09:36:26 dlg Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.36 2014/06/09 08:52:43 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.37 2014/07/02 19:49:38 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -147,14 +147,14 @@ ichsmb_attach(device_t parent, device_t 
 
 	if ((conf & LPCIB_SMB_HOSTC_HSTEN) == 0) {
 		aprint_error_dev(self, "SMBus disabled\n");
-		return;
+		goto out;
 	}
 
 	/* Map I/O space */
 	if (pci_mapreg_map(pa, LPCIB_SMB_BASE, PCI_MAPREG_TYPE_IO, 0,
 	    &sc->sc_iot, &sc->sc_ioh, NULL, &iosize)) {
 		aprint_error_dev(self, "can't map I/O space\n");
-		return;
+		goto out;
 	}
 
 	sc->sc_poll = 1;
@@ -189,7 +189,7 @@ ichsmb_attach(device_t parent, device_t 
 	iba.iba_tag = &sc->sc_i2c_tag;
 	config_found(self, &iba, iicbus_print);
 
-	if (!pmf_device_register(self, NULL, NULL))
+out:	if (!pmf_device_register(self, NULL, NULL))
 		aprint_error_dev(self, "couldn't establish power handler\n");
 }
 

Reply via email to