public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] [PATCH] 2.5.67 Don't init zx1 agpgart on non-AGP system
@ 2003-04-21 19:33 Alex Williamson
  0 siblings, 0 replies; only message in thread
From: Alex Williamson @ 2003-04-21 19:33 UTC (permalink / raw)
  To: linux-ia64

[-- Attachment #1: Type: text/plain, Size: 213 bytes --]


   This fixes agp_hp_init() so that it doesn't try to register
the zx1 AGP driver when there is no AGP slot in the system.
Thanks,

	Alex

--
Alex Williamson                             HP Linux & Open Source Lab

[-- Attachment #2: hp-agp.diff --]
[-- Type: text/plain, Size: 1210 bytes --]

--- linux-2.5.67/drivers/char/agp/hp-agp.c~	2003-04-21 12:37:52.000000000 -0600
+++ linux-2.5.67/drivers/char/agp/hp-agp.c	2003-04-21 12:53:20.000000000 -0600
@@ -420,6 +420,9 @@
 	if (hp_zx1_setup(sba_hpa + HP_ZX1_IOC_OFFSET, lba_hpa))
 		return 1;
 
+	fake_bridge_dev.vendor = PCI_VENDOR_ID_HP;
+	fake_bridge_dev.device = PCI_DEVICE_ID_HP_ZX1_LBA;
+
 	return 0;
 }
 
@@ -435,16 +438,19 @@
 	status = acpi_get_devices("HWP0003", zx1_gart_probe, "HWP0003 AGP LBA", NULL);
 	if (!(ACPI_SUCCESS(status))) {
 		agp_bridge->type = NOT_SUPPORTED;
-		printk(KERN_INFO PFX "Didn't find an HP ZX1 Chipset.\n");
+		printk(KERN_INFO PFX "Failed to initialize zx1 AGP.\n");
 		return -ENODEV;
 	}
 
-	fake_bridge_dev.vendor = PCI_VENDOR_ID_HP;
-	fake_bridge_dev.device = PCI_DEVICE_ID_HP_ZX1_LBA;
-	hp_agp_driver.dev = &fake_bridge_dev;
-	agp_bridge->type = HP_ZX1;
-	agp_bridge->dev = &fake_bridge_dev;
-	return agp_register_driver(&hp_agp_driver);
+	if (fake_bridge_dev.vendor && !agp_bridge->type) {
+		hp_agp_driver.dev = &fake_bridge_dev;
+		agp_bridge->type = HP_ZX1;
+		agp_bridge->dev = &fake_bridge_dev;
+		return agp_register_driver(&hp_agp_driver);
+
+	} else {
+		return -ENODEV;
+	}
 }
 
 static void __exit

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-21 19:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-21 19:33 [Linux-ia64] [PATCH] 2.5.67 Don't init zx1 agpgart on non-AGP system Alex Williamson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox