1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2013 Google, Inc
11 #include <linux/libfdt.h>
14 int list_count_items(struct list_head *head)
16 struct list_head *node;
19 list_for_each(node, head)
25 #if CONFIG_IS_ENABLED(OF_REAL)
26 int pci_get_devfn(struct udevice *dev)
28 struct fdt_pci_addr addr;
31 /* Extract the devfn from fdt_pci_addr */
32 ret = ofnode_read_pci_addr(dev_ofnode(dev), FDT_PCI_SPACE_CONFIG,
39 return addr.phys_hi & 0xff00;