# Re: \[PATCH 01/15\] PCI: introduce pci\_device\_to\_OF\_node() for !CONFIG\_OF

- From: Michael Ellerman \<mpe@ellerman.id.au\>
- Date: 2015-02-02 02:28:22 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2015/02/9482327
- Thread: https://ratatoskr.run/linux-pci/2015/01/9482307/t.md

```text
On Sat, 2015-01-31 at 21:47 +0800, Kevin Hao wrote:
> 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.

cheers

> 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
```
