Unverified Commit 8bf376b0 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!4109 PCI: add a member in 'struct pci_bus' to record the original 'pci_ops'

parents 901db475 41030ce5
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -897,6 +897,7 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge)

	bus->sysdata = bridge->sysdata;
	bus->ops = bridge->ops;
	bus->backup_ops = bus->ops;
	bus->number = bus->busn_res.start = bridge->busnr;
#ifdef CONFIG_PCI_DOMAINS_GENERIC
	if (bridge->domain_nr == PCI_DOMAIN_NR_NOT_SET)
@@ -1098,10 +1099,15 @@ static struct pci_bus *pci_alloc_child_bus(struct pci_bus *parent,
	child->bus_flags = parent->bus_flags;

	host = pci_find_host_bridge(parent);
	if (host->child_ops)
	if (host->child_ops) {
		child->ops = host->child_ops;
	} else {
		if (parent->backup_ops)
			child->ops = parent->backup_ops;
		else
			child->ops = parent->ops;
	}
	child->backup_ops = child->ops;

	/*
	 * Initialize some portions of the bus device, but don't register
+1 −0
Original line number Diff line number Diff line
@@ -657,6 +657,7 @@ struct pci_bus {
	struct resource busn_res;	/* Bus numbers routed to this bus */

	struct pci_ops	*ops;		/* Configuration access functions */
	struct pci_ops	*backup_ops;
	void		*sysdata;	/* Hook for sys-specific extension */
	struct proc_dir_entry *procdir;	/* Directory entry in /proc/bus/pci */