Blame view

kernel/linux-imx6_3.14.28/drivers/pci/hotplug-pci.c 708 Bytes
6b13f685e   김민수   BSP 최초 추가
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  /* Core PCI functionality used only by PCI hotplug */
  
  #include <linux/pci.h>
  #include <linux/export.h>
  #include "pci.h"
  
  int __ref pci_hp_add_bridge(struct pci_dev *dev)
  {
  	struct pci_bus *parent = dev->bus;
  	int pass, busnr, start = parent->busn_res.start;
  	int end = parent->busn_res.end;
  
  	for (busnr = start; busnr <= end; busnr++) {
  		if (!pci_find_bus(pci_domain_nr(parent), busnr))
  			break;
  	}
  	if (busnr-- > end) {
  		printk(KERN_ERR "No bus number available for hot-added bridge %s
  ",
  				pci_name(dev));
  		return -1;
  	}
  	for (pass = 0; pass < 2; pass++)
  		busnr = pci_scan_bridge(parent, dev, busnr, pass);
  	if (!dev->subordinate)
  		return -1;
  
  	return 0;
  }
  EXPORT_SYMBOL_GPL(pci_hp_add_bridge);