Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/drm/dist/bsd-core register with pmf



details:   https://anonhg.NetBSD.org/src/rev/54c67071fe01
branches:  trunk
changeset: 747682:54c67071fe01
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Sep 27 12:58:51 2009 +0000

description:
register with pmf

diffstat:

 sys/external/bsd/drm/dist/bsd-core/via_drv.c |  13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diffs (31 lines):

diff -r e1e6b9d6d75f -r 54c67071fe01 sys/external/bsd/drm/dist/bsd-core/via_drv.c
--- a/sys/external/bsd/drm/dist/bsd-core/via_drv.c      Sun Sep 27 12:53:46 2009 +0000
+++ b/sys/external/bsd/drm/dist/bsd-core/via_drv.c      Sun Sep 27 12:58:51 2009 +0000
@@ -136,6 +136,9 @@
        struct pci_attach_args *pa = aux;
        struct drm_device *dev = device_private(self);
 
+       if (!pmf_device_register(self, NULL, NULL))
+               aprint_error_dev(self, "couldn't establish power handler\n");
+
        dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER,
            M_WAITOK | M_ZERO);
 
@@ -144,8 +147,16 @@
        drm_attach(self, pa, via_pciidlist);
 }
 
+static int
+viadrm_detach(device_t self, int flags)
+{
+       pmf_device_deregister(self);
+
+       return drm_detach(self, flags);
+}
+
 CFATTACH_DECL_NEW(viadrm, sizeof(struct drm_device),
-    viadrm_probe, viadrm_attach, drm_detach, drm_activate);
+    viadrm_probe, viadrm_attach, viadrm_detach, drm_activate);
 
 #ifdef _MODULE
 



Home | Main Index | Thread Index | Old Index