Module Name:    src
Committed By:   maya
Date:           Thu Jan 16 07:18:08 UTC 2020

Modified Files:
        src/sys/dev/dm: device-mapper.c

Log Message:
dm(8) doesn't cause problems on suspend, don't block it.

Tested by Matthias Petermann, thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/dm/device-mapper.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/dm/device-mapper.c
diff -u src/sys/dev/dm/device-mapper.c:1.59 src/sys/dev/dm/device-mapper.c:1.60
--- src/sys/dev/dm/device-mapper.c:1.59	Sun Dec 22 13:16:09 2019
+++ src/sys/dev/dm/device-mapper.c	Thu Jan 16 07:18:08 2020
@@ -1,4 +1,4 @@
-/*        $NetBSD: device-mapper.c,v 1.59 2019/12/22 13:16:09 tkusumi Exp $ */
+/*        $NetBSD: device-mapper.c,v 1.60 2020/01/16 07:18:08 maya Exp $ */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -245,6 +245,9 @@ dm_match(device_t parent, cfdata_t match
 static void
 dm_attach(device_t parent, device_t self, void *aux)
 {
+
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "couldn't establish power handler\n");
 }
 
 /*
@@ -259,6 +262,8 @@ dm_detach(device_t self, int flags)
 {
 	dm_dev_t *dmv;
 
+	pmf_device_deregister(self);
+
 	/* Detach device from global device list */
 	if ((dmv = dm_dev_detach(self)) == NULL)
 		return ENOENT;

Reply via email to