pciauto_setup_device bars_num fix
authorEd Swarthout <Ed.Swarthout@freescale.com>
Fri, 27 Jul 2007 06:50:44 +0000 (01:50 -0500)
committerJon Loeliger <jdl@freescale.com>
Fri, 10 Aug 2007 16:09:00 +0000 (11:09 -0500)
Passing bars_num=0 to pciauto_setup_device should assign no bars.

Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
Acked-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Acked-by: Andy Fleming <afleming@freescale.com>
drivers/pci_auto.c

index a3c609ba49ccd9f7abbc00522f4784dae85d95a9..2378553be5acf75fe3992301e2fb43390e96a5ff 100644 (file)
@@ -94,7 +94,7 @@ void pciauto_setup_device(struct pci_controller *hose,
        pci_hose_read_config_dword(hose, dev, PCI_COMMAND, &cmdstat);
        cmdstat = (cmdstat & ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) | PCI_COMMAND_MASTER;
 
-       for (bar = PCI_BASE_ADDRESS_0; bar <= PCI_BASE_ADDRESS_0 + (bars_num*4); bar += 4) {
+       for (bar = PCI_BASE_ADDRESS_0; bar < PCI_BASE_ADDRESS_0 + (bars_num*4); bar += 4) {
                /* Tickle the BAR and get the response */
                pci_hose_write_config_dword(hose, dev, bar, 0xffffffff);
                pci_hose_read_config_dword(hose, dev, bar, &bar_response);