mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <dev@lynxeye.de>
To: barebox@lists.infradead.org
Subject: [PATCH 1/2] fixup! of: import pci range parser from linux
Date: Wed,  1 Oct 2014 21:14:14 +0200	[thread overview]
Message-ID: <1412190855-14289-2-git-send-email-dev@lynxeye.de> (raw)
In-Reply-To: <1412190855-14289-1-git-send-email-dev@lynxeye.de>

Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
Correct dependencies and put function definitions under
correct ifdef to avoid build warnings/errors on systems
with PCI but without OF.
---
 drivers/of/Kconfig   |  1 +
 drivers/of/address.c |  4 ++--
 include/of_address.h | 22 +++++++++++++++-------
 3 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
index 8195506..39cd138 100644
--- a/drivers/of/Kconfig
+++ b/drivers/of/Kconfig
@@ -30,6 +30,7 @@ config OF_GPIO
 config OF_PCI
 	bool
 	depends on PCI
+	select OF_ADDRESS_PCI
 	help
 	  OpenFirmware PCI bus accessors
 
diff --git a/drivers/of/address.c b/drivers/of/address.c
index 15f3ade..8018d78 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -179,7 +179,7 @@ static int of_bus_pci_translate(__be32 *addr, u64 offset, int na)
 }
 #endif /* CONFIG_OF_ADDRESS_PCI */
 
-#ifdef CONFIG_PCI
+#ifdef CONFIG_OF_PCI
 int of_pci_range_parser_init(struct of_pci_range_parser *parser,
 				struct device_node *node)
 {
@@ -245,7 +245,7 @@ struct of_pci_range *of_pci_range_parser_one(struct of_pci_range_parser *parser,
 	return range;
 }
 EXPORT_SYMBOL_GPL(of_pci_range_parser_one);
-#endif /* CONFIG_PCI */
+#endif /* CONFIG_OF_PCI */
 
 /*
  * Array of bus specific translators
diff --git a/include/of_address.h b/include/of_address.h
index f9c3c0f..cef785e 100644
--- a/include/of_address.h
+++ b/include/of_address.h
@@ -55,11 +55,7 @@ extern struct device_node *of_find_matching_node_by_address(
 	struct device_node *from, const struct of_device_id *matches,
 	u64 base_address);
 extern void __iomem *of_iomap(struct device_node *np, int index);
-extern int of_pci_range_parser_init(struct of_pci_range_parser *parser,
-			struct device_node *node);
-extern struct of_pci_range *of_pci_range_parser_one(
-			struct of_pci_range_parser *parser,
-			struct of_pci_range *range);
+
 #else /* CONFIG_OFTREE */
 
 static inline u64 of_translate_address(struct device_node *dev,
@@ -103,6 +99,20 @@ static inline void __iomem *of_iomap(struct device_node *np, int index)
 	return NULL;
 }
 
+#endif /* CONFIG_OFTREE */
+
+#ifdef CONFIG_OF_PCI
+
+extern int of_pci_range_parser_init(struct of_pci_range_parser *parser,
+			struct device_node *node);
+
+extern struct of_pci_range *of_pci_range_parser_one(
+			struct of_pci_range_parser *parser,
+			struct of_pci_range *range);
+
+#else
+
+#endif /* CONFIG_OF_PCI */
 static inline int of_pci_range_parser_init(struct of_pci_range_parser *parser,
 			struct device_node *node)
 {
@@ -116,6 +126,4 @@ static inline struct of_pci_range *of_pci_range_parser_one(
 	return NULL;
 }
 
-#endif /* CONFIG_OFTREE */
-
 #endif /* __OF_ADDRESS_H */
-- 
1.9.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2014-10-01 19:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-01 19:14 [PATCH 0/2] Increamental fixes for the PCI series Lucas Stach
2014-10-01 19:14 ` Lucas Stach [this message]
2014-10-01 19:14 ` [PATCH 2/2] MIPS: malta: fix pci IO resource assignment Lucas Stach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1412190855-14289-2-git-send-email-dev@lynxeye.de \
    --to=dev@lynxeye.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox