提交 a48a687d 编写于 作者: C Changbin Du 提交者: Bjorn Helgaas

PCI: Move pci_map_rom() error path

Move pci_map_rom() error code to the end to prepare for adding another
error path.  No functional change intended.
Signed-off-by: NChangbin Du <changbin.du@intel.com>
[bhelgaas: split non-functional change into separate patch]
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
上级 fa564ad9
...@@ -147,12 +147,8 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size) ...@@ -147,12 +147,8 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size)
return NULL; return NULL;
rom = ioremap(start, *size); rom = ioremap(start, *size);
if (!rom) { if (!rom)
/* restore enable if ioremap fails */ goto err_ioremap;
if (!(res->flags & IORESOURCE_ROM_ENABLE))
pci_disable_rom(pdev);
return NULL;
}
/* /*
* Try to find the true size of the ROM since sometimes the PCI window * Try to find the true size of the ROM since sometimes the PCI window
...@@ -161,6 +157,12 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size) ...@@ -161,6 +157,12 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size)
*/ */
*size = pci_get_rom_size(pdev, rom, *size); *size = pci_get_rom_size(pdev, rom, *size);
return rom; return rom;
err_ioremap:
/* restore enable if ioremap fails */
if (!(res->flags & IORESOURCE_ROM_ENABLE))
pci_disable_rom(pdev);
return NULL;
} }
EXPORT_SYMBOL(pci_map_rom); EXPORT_SYMBOL(pci_map_rom);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册