1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2013 Google, Inc
11 #include <linux/libfdt.h>
12 #include <linux/list.h>
14 #if CONFIG_IS_ENABLED(OF_REAL)
15 int pci_get_devfn(struct udevice *dev)
17 struct fdt_pci_addr addr;
20 /* Extract the devfn from fdt_pci_addr */
21 ret = ofnode_read_pci_addr(dev_ofnode(dev), FDT_PCI_SPACE_CONFIG,
28 return addr.phys_hi & 0xff00;