adapt for devfs
authorSimon Schubert <simon.schubert@epfl.ch>
Fri, 14 Aug 2009 12:59:19 +0000 (14:59 +0200)
committerSimon Schubert <simon.schubert@epfl.ch>
Fri, 14 Aug 2009 12:59:19 +0000 (14:59 +0200)
src/nvidia_ctl.c
src/nvidia_dev.c

index 6f492a8..2d60f46 100644 (file)
@@ -119,12 +119,13 @@ int nvidia_ctl_attach(void)
          * This routine is called from nvidia_attach(), multiple times
          * when more than one device is installed.
          */
+#if __DragonFly_version < 200205
        dev_ops_add(&nvidia_ctl_ops, -1, CDEV_CTL_MINOR);
+#endif
         nvidia_ctl_cdev = make_dev(&nvidia_ctl_ops,
                 CDEV_CTL_MINOR,
                 UID_ROOT, GID_WHEEL, 0666,
                 "%s", nvidia_ctl_ops.head.name);
-       reference_dev(nvidia_ctl_cdev);
     }
 
     nvidia_count++;
@@ -143,7 +144,9 @@ int nvidia_ctl_detach(void)
          * Like nvidia_ctl_attach(), nvidia_ctl_detach() will also be
          * called more than once with multiple devices.
          */
+#if __DragonFly_version < 200205
        dev_ops_remove(&nvidia_ctl_ops, -1, CDEV_CTL_MINOR);
+#endif
        destroy_dev(nvidia_ctl_cdev);
     }
 
index 1e8b8b9..6f21b7a 100644 (file)
@@ -161,20 +161,23 @@ int nvidia_dev_mmap(
 
 int nvidia_dev_attach(struct nvidia_softc *sc)
 {
+#if __DragonFly_version < 200205
     dev_ops_add(&nvidia_dev_ops, -1, device_get_unit(sc->dev));
+#endif
     sc->cdev = make_dev(&nvidia_dev_ops,
             device_get_unit(sc->dev),
             UID_ROOT, GID_WHEEL, 0666,
             "%s%d", nvidia_dev_ops.head.name,
             device_get_unit(sc->dev));
-    reference_dev(sc->cdev);
 
     return 0;
 }
 
 int nvidia_dev_detach(struct nvidia_softc *sc)
 {
+#if __DragonFly_version < 200205
     dev_ops_remove(&nvidia_dev_ops, -1, device_get_unit(sc->dev));
+#endif
     destroy_dev(sc->cdev);
     return 0;
 }