Browse files

lib/devres.c: fix misplaced #endif

A misplaced #endif causes link errors related to pcim_*() functions.

This is because pcim_*() functions are related to CONFIG_PCI option,
however these are not related to CONFIG_HAS_IOPORT option.  Therefore,
when CONFIG_PCI is enabled and CONFIG_HAS_IOPORT is not enabled, it makes
link errors related to pcim_*() functions as below:

drivers/ata/libata-sff.c:3233: undefined reference to `pcim_iomap_regions'
drivers/ata/libata-sff.c:3238: undefined reference to `pcim_iomap_table'
drivers/built-in.o: In function `ata_pci_sff_init_host':
drivers/ata/libata-sff.c:2318: undefined reference to `pcim_iomap_regions'
drivers/ata/libata-sff.c:2329: undefined reference to `pcim_iomap_table

Signed-off-by: Jingoo Han <>
Cc: Greg KH <>
Cc: Tejun Heo <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
  • Loading branch information...
jingoo authored and torvalds committed Feb 28, 2013
1 parent a003119 commit 9ed8a30f3471347c1b763bd062fa78ae80f18eae
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/devres.c
@@ -227,6 +227,7 @@ void devm_ioport_unmap(struct device *dev, void __iomem *addr)
devm_ioport_map_match, (void *)addr));
+#endif /* CONFIG_HAS_IOPORT */
@@ -432,4 +433,3 @@ void pcim_iounmap_regions(struct pci_dev *pdev, int mask)
#endif /* CONFIG_PCI */
-#endif /* CONFIG_HAS_IOPORT */

0 comments on commit 9ed8a30

Please sign in to comment.