Merge tag 'pci-v6.16-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci
[linux-2.6-block.git] / arch / arm64 / kernel / pci.c
CommitLineData
d2912cb1 1// SPDX-License-Identifier: GPL-2.0-only
d1e6dc91
LD
2/*
3 * Code borrowed from powerpc/kernel/pci-common.c
4 *
5 * Copyright (C) 2003 Anton Blanchard <anton@au.ibm.com>, IBM
6 * Copyright (C) 2014 ARM Ltd.
d1e6dc91
LD
7 */
8
2ab51dde 9#include <linux/pci.h>
a9cb97fe
HG
10
11/*
12 * raw_pci_read/write - Platform-specific PCI config space access.
13 */
14int raw_pci_read(unsigned int domain, unsigned int bus,
15 unsigned int devfn, int reg, int len, u32 *val)
16{
f058f4fb
TN
17 struct pci_bus *b = pci_find_bus(domain, bus);
18
19 if (!b)
20 return PCIBIOS_DEVICE_NOT_FOUND;
21 return b->ops->read(b, devfn, reg, len, val);
a9cb97fe
HG
22}
23
24int raw_pci_write(unsigned int domain, unsigned int bus,
25 unsigned int devfn, int reg, int len, u32 val)
26{
f058f4fb
TN
27 struct pci_bus *b = pci_find_bus(domain, bus);
28
29 if (!b)
30 return PCIBIOS_DEVICE_NOT_FOUND;
31 return b->ops->write(b, devfn, reg, len, val);
a9cb97fe
HG
32}
33
1a2db300
GK
34#ifdef CONFIG_NUMA
35
36int pcibus_to_node(struct pci_bus *bus)
37{
38 return dev_to_node(&bus->dev);
39}
40EXPORT_SYMBOL(pcibus_to_node);
41
42#endif