diff --git a/lib/devres.c b/lib/devres.c
index 7c0e953a7486afa4fd5ef9bf98346b4f41e810a9..78777aea5b3426189b977bb852e4898578c34818 100644
--- a/lib/devres.c
+++ b/lib/devres.c
@@ -348,5 +348,5 @@ void pcim_iounmap_regions(struct pci_dev *pdev, u16 mask)
 	}
 }
 EXPORT_SYMBOL(pcim_iounmap_regions);
-#endif
-#endif
+#endif /* CONFIG_PCI */
+#endif /* CONFIG_HAS_IOPORT */