Open AGP module in init_driver().

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23711 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2008-01-23 19:26:32 +00:00
parent 59096777ec
commit 34a95c6d57
1 changed files with 13 additions and 8 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2006-2007, Haiku, Inc. All Rights Reserved.
* Copyright 2006-2008, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -11,15 +11,15 @@
#include "device.h"
#include "lock.h"
#include <OS.h>
#include <KernelExport.h>
#include <SupportDefs.h>
#include <PCI.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <AGP.h>
#include <KernelExport.h>
#include <OS.h>
#include <PCI.h>
#include <SupportDefs.h>
#define TRACE_DRIVER
#ifdef TRACE_DRIVER
@ -59,6 +59,7 @@ int32 api_version = B_CUR_DRIVER_API_VERSION;
char *gDeviceNames[MAX_CARDS + 1];
intel_info *gDeviceInfo[MAX_CARDS];
pci_module_info *gPCI;
agp_module_info *gAGP;
lock gLock;
@ -125,7 +126,7 @@ init_driver(void)
{
TRACE((DEVICE_NAME ": init_driver()\n"));
status_t status = get_module(B_PCI_MODULE_NAME,(module_info **)&gPCI);
status_t status = get_module(B_PCI_MODULE_NAME, (module_info **)&gPCI);
if (status != B_OK) {
TRACE((DEVICE_NAME ": pci module unavailable\n"));
return status;
@ -137,6 +138,8 @@ init_driver(void)
return status;
}
get_module(B_AGP_MODULE_NAME, (module_info **)&gAGP);
// find devices
int32 found = 0;
@ -211,6 +214,8 @@ uninit_driver(void)
free(name);
}
if (gAGP != NULL)
put_module(B_AGP_MODULE_NAME);
put_module(B_PCI_MODULE_NAME);
}