Fully synchronize sys/boot from FreeBSD-5.x, but add / to the module path
[dragonfly.git] / sys / dev / video / fb / fb.c
index 3aa5a7c..d2cdd7c 100644 (file)
@@ -26,7 +26,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/fb/fb.c,v 1.11.2.2 2000/08/02 22:35:22 peter Exp $
- * $DragonFly: src/sys/dev/video/fb/fb.c,v 1.6 2003/08/07 21:17:15 dillon Exp $
+ * $DragonFly: src/sys/dev/video/fb/fb.c,v 1.7 2003/11/10 06:12:09 dillon Exp $
  */
 
 #include "opt_fb.h"
@@ -39,6 +39,7 @@
 #include <sys/malloc.h>
 #include <sys/uio.h>
 #include <sys/fbio.h>
+#include <sys/linker_set.h>
 #include <sys/device.h>
 
 #include <vm/vm.h>
@@ -46,6 +47,8 @@
 
 #include "fbreg.h"
 
+SET_DECLARE(videodriver_set, const video_driver_t);
+
 /* local arrays */
 
 /*
@@ -162,8 +165,8 @@ vid_register(video_adapter_t *adp)
 
        adp->va_index = index;
        adp->va_token = NULL;
-       list = (const video_driver_t **)videodriver_set.ls_items;
-       while ((p = *list++) != NULL) {
+       SET_FOREACH(list, videodriver_set) {
+               p = *list;
                if (strcmp(p->name, adp->va_name) == 0) {
                        adapter[index] = adp;
                        vidsw[index] = p->vidsw;
@@ -194,8 +197,8 @@ video_switch_t
        const video_driver_t **list;
        const video_driver_t *p;
 
-       list = (const video_driver_t **)videodriver_set.ls_items;
-       while ((p = *list++) != NULL) {
+       SET_FOREACH(list, videodriver_set) {
+               p = *list;
                if (strcmp(p->name, name) == 0)
                        return p->vidsw;
        }
@@ -283,8 +286,8 @@ vid_configure(int flags)
        const video_driver_t **list;
        const video_driver_t *p;
 
-       list = (const video_driver_t **)videodriver_set.ls_items;
-       while ((p = *list++) != NULL) {
+       SET_FOREACH(list, videodriver_set) {
+               p = *list;
                if (p->configure != NULL)
                        (*p->configure)(flags);
        }