Re: [PATCH 01/15] PCI: introduce pci_device_to_OF_node() for !CONFIG_OF

From
Bjorn Helgaas <bhelgaas@google.com>
Date
2015-02-02 15:48:20
Also in
linux-pci
Reply to
Michael Ellerman, 2015-02-02
On Sun, Feb 1, 2015 at 8:28 PM, Michael Ellerman [off-list ref] wrote:
On Sat, 2015-01-31 at 21:47 +0800, Kevin Hao wrote:
quoted
So we can avoid the ugly #ifdef in some drivers.

Signed-off-by: Kevin Hao <redacted>
---
 include/linux/pci.h | 2 ++
 1 file changed, 2 insertions(+)

Hi Bjorn,

Do you mind putting this into your next for 3.20? Or giving us an ACK for it if
you prefer.
I think it makes more sense to merge this along with the other 14
patches that remove the #ifdefs (at least, I assume that's what they
do; I haven't seen them).

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

But please edit the subject line so it is capitalized consistently
with the rest of the history.  And it'd be nice if the changelog were
a complete sentence all by itself, e.g.,

    PCI: Add pci_device_to_OF_node() stub for !CONFIG_OF

    Add a stub for pci_device_to_OF_node() so drivers don't need to use
    #ifdef CONFIG_OF around calls to it.

Bjorn
quoted
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 8323cbf93913..421eb6a9e600 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1863,6 +1863,8 @@ static inline void pci_set_of_node(struct pci_dev *dev) { }
 static inline void pci_release_of_node(struct pci_dev *dev) { }
 static inline void pci_set_bus_of_node(struct pci_bus *bus) { }
 static inline void pci_release_bus_of_node(struct pci_bus *bus) { }
+static inline struct device_node *
+pci_device_to_OF_node(const struct pci_dev *pdev) { return NULL; }
 #endif  /* CONFIG_OF */

 #ifdef CONFIG_EEH

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thread (39 messages) 39 messages, 9 authors, last reply 2015-03-11
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help