aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/setup-pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/setup-pci.c')
-rw-r--r--drivers/ide/setup-pci.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index 25fd09053220..d2cd5a3d38f8 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -704,7 +704,7 @@ EXPORT_SYMBOL_GPL(ide_setup_pci_devices);
704/* 704/*
705 * Module interfaces 705 * Module interfaces
706 */ 706 */
707 707
708static int pre_init = 1; /* Before first ordered IDE scan */ 708static int pre_init = 1; /* Before first ordered IDE scan */
709static LIST_HEAD(ide_pci_drivers); 709static LIST_HEAD(ide_pci_drivers);
710 710
@@ -714,7 +714,7 @@ static LIST_HEAD(ide_pci_drivers);
714 * @module: owner module of the driver 714 * @module: owner module of the driver
715 * 715 *
716 * Registers a driver with the IDE layer. The IDE layer arranges that 716 * Registers a driver with the IDE layer. The IDE layer arranges that
717 * boot time setup is done in the expected device order and then 717 * boot time setup is done in the expected device order and then
718 * hands the controllers off to the core PCI code to do the rest of 718 * hands the controllers off to the core PCI code to do the rest of
719 * the work. 719 * the work.
720 * 720 *
@@ -724,13 +724,12 @@ static LIST_HEAD(ide_pci_drivers);
724int __ide_pci_register_driver(struct pci_driver *driver, struct module *module, 724int __ide_pci_register_driver(struct pci_driver *driver, struct module *module,
725 const char *mod_name) 725 const char *mod_name)
726{ 726{
727 if(!pre_init) 727 if (!pre_init)
728 return __pci_register_driver(driver, module, mod_name); 728 return __pci_register_driver(driver, module, mod_name);
729 driver->driver.owner = module; 729 driver->driver.owner = module;
730 list_add_tail(&driver->node, &ide_pci_drivers); 730 list_add_tail(&driver->node, &ide_pci_drivers);
731 return 0; 731 return 0;
732} 732}
733
734EXPORT_SYMBOL_GPL(__ide_pci_register_driver); 733EXPORT_SYMBOL_GPL(__ide_pci_register_driver);
735 734
736/** 735/**
@@ -741,17 +740,18 @@ EXPORT_SYMBOL_GPL(__ide_pci_register_driver);
741 * This is only used during boot up to get the ordering correct. After 740 * This is only used during boot up to get the ordering correct. After
742 * boot up the pci layer takes over the job. 741 * boot up the pci layer takes over the job.
743 */ 742 */
744 743
745static int __init ide_scan_pcidev(struct pci_dev *dev) 744static int __init ide_scan_pcidev(struct pci_dev *dev)
746{ 745{
747 struct list_head *l; 746 struct list_head *l;
748 struct pci_driver *d; 747 struct pci_driver *d;
749 748
750 list_for_each(l, &ide_pci_drivers) { 749 list_for_each(l, &ide_pci_drivers) {
751 d = list_entry(l, struct pci_driver, node); 750 d = list_entry(l, struct pci_driver, node);
752 if (d->id_table) { 751 if (d->id_table) {
753 const struct pci_device_id *id = pci_match_id(d->id_table, 752 const struct pci_device_id *id =
754 dev); 753 pci_match_id(d->id_table, dev);
754
755 if (id != NULL && d->probe(dev, id) >= 0) { 755 if (id != NULL && d->probe(dev, id) >= 0) {
756 dev->driver = d; 756 dev->driver = d;
757 pci_dev_get(dev); 757 pci_dev_get(dev);
@@ -779,13 +779,13 @@ void __init ide_scan_pcibus (int scan_direction)
779 779
780 pre_init = 0; 780 pre_init = 0;
781 if (!scan_direction) 781 if (!scan_direction)
782 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) 782 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)))
783 ide_scan_pcidev(dev); 783 ide_scan_pcidev(dev);
784 else 784 else
785 while ((dev = pci_get_device_reverse(PCI_ANY_ID, PCI_ANY_ID, dev)) 785 while ((dev = pci_get_device_reverse(PCI_ANY_ID, PCI_ANY_ID,
786 != NULL) 786 dev)))
787 ide_scan_pcidev(dev); 787 ide_scan_pcidev(dev);
788 788
789 /* 789 /*
790 * Hand the drivers over to the PCI layer now we 790 * Hand the drivers over to the PCI layer now we
791 * are post init. 791 * are post init.
@@ -794,9 +794,10 @@ void __init ide_scan_pcibus (int scan_direction)
794 list_for_each_safe(l, n, &ide_pci_drivers) { 794 list_for_each_safe(l, n, &ide_pci_drivers) {
795 list_del(l); 795 list_del(l);
796 d = list_entry(l, struct pci_driver, node); 796 d = list_entry(l, struct pci_driver, node);
797 if (__pci_register_driver(d, d->driver.owner, d->driver.mod_name)) 797 if (__pci_register_driver(d, d->driver.owner,
798 printk(KERN_ERR "%s: failed to register driver for %s\n", 798 d->driver.mod_name))
799 __FUNCTION__, d->driver.mod_name); 799 printk(KERN_ERR "%s: failed to register %s driver\n",
800 __FUNCTION__, d->driver.mod_name);
800 } 801 }
801} 802}
802#endif 803#endif