Patchwork PCI ROM run fix and warning fix

login
register
about
Submitter Myles Watson
Date 2009-10-07 16:40:36
Message ID <2831fecf0910070940x1f417d60mbcbcdaf2c25fb6fc@mail.gmail.com>
Download mbox | patch
Permalink /patch/361/
State Accepted
Headers show

Comments

Myles Watson - 2009-10-07 16:40:36
Kconfig allows you to run all PCI ROMs, VGA only, or non-VGA only.
Update the code to support that too.

Remove an unused variable.

Boot tested.

Signed-off-by: Myles Watson <mylesgw@gmail.com>

Thanks,
Myles
Peter Stuge - 2009-10-07 18:23:56
Myles Watson wrote:
> Kconfig allows you to run all PCI ROMs, VGA only, or non-VGA only.
> Update the code to support that too.
> 
> Remove an unused variable.
> 
> Boot tested.
> 
> Signed-off-by: Myles Watson <mylesgw@gmail.com>

Nice!

Acked-by: Peter Stuge <peter@stuge.se>
Myles Watson - 2009-10-07 18:41:52
> Nice!
:)

> Acked-by: Peter Stuge <peter@stuge.se>
Rev 4738.

Thanks,
Myles

Patch

Index: svn/src/devices/pci_device.c
===================================================================
--- svn.orig/src/devices/pci_device.c
+++ svn/src/devices/pci_device.c
@@ -669,14 +669,13 @@  void pci_dev_init(struct device *dev)
 	void run_bios(struct device *dev, unsigned long addr);
 	struct rom_header *rom, *ram;
 
-#if CONFIG_PCI_ROM_RUN != 1
-	/* We want to execute VGA option ROMs when CONFIG_VGA_ROM_RUN
-	 * is set but CONFIG_PCI_ROM_RUN is not. In this case we skip
-	 * all other option ROM types.
-	 */
-	if ((dev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
+	if (CONFIG_PCI_ROM_RUN != 1 && /* Only execute VGA ROMs. */
+	    ((dev->class >> 8) != PCI_CLASS_DISPLAY_VGA))
+		return;
+
+	if (CONFIG_VGA_ROM_RUN != 1 && /* Only execute non-VGA ROMs. */
+	    ((dev->class >> 8) == PCI_CLASS_DISPLAY_VGA))
 		return;
-#endif
 
 	rom = pci_rom_probe(dev);
 	if (rom == NULL)
@@ -1224,7 +1223,6 @@  void pci_assign_irqs(unsigned bus, unsig
 	device_t pdev;
 	u8 line;
 	u8 irq;
-	u8 readback;
 
 	/* Each slot may contain up to eight functions */
 	for (funct = 0; funct < 8; funct++) {
@@ -1248,8 +1246,8 @@  void pci_assign_irqs(unsigned bus, unsig
 			pIntAtoD[line - 1]);
 
 #ifdef PARANOID_IRQ_ASSIGNMENTS
-		readback = pci_read_config8(pdev, PCI_INTERRUPT_LINE);
-		printk_debug("  Readback = %d\n", readback);
+		irq = pci_read_config8(pdev, PCI_INTERRUPT_LINE);
+		printk_debug("  Readback = %d\n", irq);
 #endif
 
 		// Change to level triggered