提交 117430b1 编写于 作者: L Linus Torvalds

Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6:
  pci: fix section mismatch warning
  PCI: aer: fix section mismatch warning
  pcie: fix section mismatch warning
  PCI: allow multiple calls to pcim_pin_device()
...@@ -757,7 +757,8 @@ int pci_enable_device(struct pci_dev *dev) ...@@ -757,7 +757,8 @@ int pci_enable_device(struct pci_dev *dev)
* when a device is enabled using managed PCI device enable interface. * when a device is enabled using managed PCI device enable interface.
*/ */
struct pci_devres { struct pci_devres {
unsigned int disable:1; unsigned int enabled:1;
unsigned int pinned:1;
unsigned int orig_intx:1; unsigned int orig_intx:1;
unsigned int restore_intx:1; unsigned int restore_intx:1;
u32 region_mask; u32 region_mask;
...@@ -781,7 +782,7 @@ static void pcim_release(struct device *gendev, void *res) ...@@ -781,7 +782,7 @@ static void pcim_release(struct device *gendev, void *res)
if (this->restore_intx) if (this->restore_intx)
pci_intx(dev, this->orig_intx); pci_intx(dev, this->orig_intx);
if (this->disable) if (this->enabled && !this->pinned)
pci_disable_device(dev); pci_disable_device(dev);
} }
...@@ -820,12 +821,12 @@ int pcim_enable_device(struct pci_dev *pdev) ...@@ -820,12 +821,12 @@ int pcim_enable_device(struct pci_dev *pdev)
dr = get_pci_dr(pdev); dr = get_pci_dr(pdev);
if (unlikely(!dr)) if (unlikely(!dr))
return -ENOMEM; return -ENOMEM;
WARN_ON(!!dr->disable); WARN_ON(!!dr->enabled);
rc = pci_enable_device(pdev); rc = pci_enable_device(pdev);
if (!rc) { if (!rc) {
pdev->is_managed = 1; pdev->is_managed = 1;
dr->disable = 1; dr->enabled = 1;
} }
return rc; return rc;
} }
...@@ -843,9 +844,9 @@ void pcim_pin_device(struct pci_dev *pdev) ...@@ -843,9 +844,9 @@ void pcim_pin_device(struct pci_dev *pdev)
struct pci_devres *dr; struct pci_devres *dr;
dr = find_pci_dr(pdev); dr = find_pci_dr(pdev);
WARN_ON(!dr || !dr->disable); WARN_ON(!dr || !dr->enabled);
if (dr) if (dr)
dr->disable = 0; dr->pinned = 1;
} }
/** /**
...@@ -876,7 +877,7 @@ pci_disable_device(struct pci_dev *dev) ...@@ -876,7 +877,7 @@ pci_disable_device(struct pci_dev *dev)
dr = find_pci_dr(dev); dr = find_pci_dr(dev);
if (dr) if (dr)
dr->disable = 0; dr->enabled = 0;
if (atomic_sub_return(1, &dev->enable_cnt) != 0) if (atomic_sub_return(1, &dev->enable_cnt) != 0)
return; return;
......
...@@ -66,7 +66,7 @@ static struct pci_error_handlers aer_error_handlers = { ...@@ -66,7 +66,7 @@ static struct pci_error_handlers aer_error_handlers = {
.resume = aer_error_resume, .resume = aer_error_resume,
}; };
static struct pcie_port_service_driver aerdrv = { static struct pcie_port_service_driver aerdriver = {
.name = "aer", .name = "aer",
.id_table = &aer_id[0], .id_table = &aer_id[0],
...@@ -328,7 +328,7 @@ static void aer_error_resume(struct pci_dev *dev) ...@@ -328,7 +328,7 @@ static void aer_error_resume(struct pci_dev *dev)
**/ **/
static int __init aer_service_init(void) static int __init aer_service_init(void)
{ {
return pcie_port_service_register(&aerdrv); return pcie_port_service_register(&aerdriver);
} }
/** /**
...@@ -338,7 +338,7 @@ static int __init aer_service_init(void) ...@@ -338,7 +338,7 @@ static int __init aer_service_init(void)
**/ **/
static void __exit aer_service_exit(void) static void __exit aer_service_exit(void)
{ {
pcie_port_service_unregister(&aerdrv); pcie_port_service_unregister(&aerdriver);
} }
module_init(aer_service_init); module_init(aer_service_init);
......
...@@ -276,7 +276,7 @@ static struct pci_error_handlers pcie_portdrv_err_handler = { ...@@ -276,7 +276,7 @@ static struct pci_error_handlers pcie_portdrv_err_handler = {
.resume = pcie_portdrv_err_resume, .resume = pcie_portdrv_err_resume,
}; };
static struct pci_driver pcie_portdrv = { static struct pci_driver pcie_portdriver = {
.name = (char *)device_name, .name = (char *)device_name,
.id_table = &port_pci_ids[0], .id_table = &port_pci_ids[0],
...@@ -298,7 +298,7 @@ static int __init pcie_portdrv_init(void) ...@@ -298,7 +298,7 @@ static int __init pcie_portdrv_init(void)
printk(KERN_WARNING "PCIE: bus_register error: %d\n", retval); printk(KERN_WARNING "PCIE: bus_register error: %d\n", retval);
goto out; goto out;
} }
retval = pci_register_driver(&pcie_portdrv); retval = pci_register_driver(&pcie_portdriver);
if (retval) if (retval)
pcie_port_bus_unregister(); pcie_port_bus_unregister();
out: out:
...@@ -307,7 +307,7 @@ static int __init pcie_portdrv_init(void) ...@@ -307,7 +307,7 @@ static int __init pcie_portdrv_init(void)
static void __exit pcie_portdrv_exit(void) static void __exit pcie_portdrv_exit(void)
{ {
pci_unregister_driver(&pcie_portdrv); pci_unregister_driver(&pcie_portdriver);
pcie_port_bus_unregister(); pcie_port_bus_unregister();
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
DECLARE_RWSEM(pci_bus_sem); DECLARE_RWSEM(pci_bus_sem);
static struct pci_bus * __devinit static struct pci_bus *
pci_do_find_bus(struct pci_bus* bus, unsigned char busnr) pci_do_find_bus(struct pci_bus* bus, unsigned char busnr)
{ {
struct pci_bus* child; struct pci_bus* child;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册