Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/iscsi register with pmf to allow suspend.



details:   https://anonhg.NetBSD.org/src/rev/3d63b032cbb0
branches:  trunk
changeset: 461870:3d63b032cbb0
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sat Jul 13 17:06:00 2019 +0000

description:
register with pmf to allow suspend.

diffstat:

 sys/dev/iscsi/iscsi_main.c |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (28 lines):

diff -r 3764ada8cd56 -r 3d63b032cbb0 sys/dev/iscsi/iscsi_main.c
--- a/sys/dev/iscsi/iscsi_main.c        Sat Jul 13 17:03:01 2019 +0000
+++ b/sys/dev/iscsi/iscsi_main.c        Sat Jul 13 17:06:00 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iscsi_main.c,v 1.29 2019/04/21 11:26:46 mlelstv Exp $  */
+/*     $NetBSD: iscsi_main.c,v 1.30 2019/07/13 17:06:00 mlelstv Exp $  */
 
 /*-
  * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -252,6 +252,9 @@
        iscsi_detaching = false;
        iscsi_init_cleanup();
 
+       if (!pmf_device_register(self, NULL, NULL))
+               aprint_error_dev(self, "couldn't establish power handler\n");
+
        aprint_normal("%s: attached.  major = %d\n", iscsi_cd.cd_name,
            cdevsw_lookup_major(&iscsi_cdevsw));
 }
@@ -285,6 +288,8 @@
        if (error)
                return error;
 
+       pmf_device_deregister(sc->dev);
+
        mutex_destroy(&sc->lock);
 
        return 0;



Home | Main Index | Thread Index | Old Index