mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-14 16:44:29 +08:00
powerpc/eeh_cache: Don't use pci_dn when inserting new ranges
At the point where we start inserting ranges into the EEH address cache the binding between pci_dev and eeh_dev has already been set up. Instead of consulting the pci_dn tree we can retrieve the eeh_dev directly using pci_dev_to_eeh_dev(). Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Sam Bobroff <sbobroff@linux.ibm.com> Tested-by: Sam Bobroff <sbobroff@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20190715085612.8802-2-oohall@gmail.com
This commit is contained in:
parent
49ce94b867
commit
b1268f4cdb
@ -159,18 +159,10 @@ eeh_addr_cache_insert(struct pci_dev *dev, resource_size_t alo,
|
|||||||
|
|
||||||
static void __eeh_addr_cache_insert_dev(struct pci_dev *dev)
|
static void __eeh_addr_cache_insert_dev(struct pci_dev *dev)
|
||||||
{
|
{
|
||||||
struct pci_dn *pdn;
|
|
||||||
struct eeh_dev *edev;
|
struct eeh_dev *edev;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
pdn = pci_get_pdn_by_devfn(dev->bus, dev->devfn);
|
edev = pci_dev_to_eeh_dev(dev);
|
||||||
if (!pdn) {
|
|
||||||
pr_warn("PCI: no pci dn found for dev=%s\n",
|
|
||||||
pci_name(dev));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
edev = pdn_to_eeh_dev(pdn);
|
|
||||||
if (!edev) {
|
if (!edev) {
|
||||||
pr_warn("PCI: no EEH dev found for %s\n",
|
pr_warn("PCI: no EEH dev found for %s\n",
|
||||||
pci_name(dev));
|
pci_name(dev));
|
||||||
|
Loading…
Reference in New Issue
Block a user