Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 200643
b: refs/heads/master
c: 5648028
h: refs/heads/master
i:
  200641: b4c320b
  200639: d089536
v: v3
  • Loading branch information
Matthew Garrett authored and Linus Torvalds committed Jun 29, 2010
1 parent 323dabf commit 2613020
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e05bd3367bd3d88715b53766f95bb3a8ec7ab59e
refs/heads/master: 56480287f9776adc5b1a7a335ef62a9b9879ad7f
21 changes: 17 additions & 4 deletions trunk/drivers/char/ipmi/ipmi_si_intf.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,12 @@ struct smi_info {

static int force_kipmid[SI_MAX_PARMS];
static int num_force_kipmid;
#ifdef CONFIG_PCI
static int pci_registered;
#endif
#ifdef CONFIG_PPC_OF
static int of_registered;
#endif

static unsigned int kipmid_max_busy_us[SI_MAX_PARMS];
static int num_max_busy_us;
Expand Down Expand Up @@ -3314,6 +3320,8 @@ static __devinit int init_ipmi_si(void)
rv = pci_register_driver(&ipmi_pci_driver);
if (rv)
printk(KERN_ERR PFX "Unable to register PCI driver: %d\n", rv);
else
pci_registered = 1;
#endif

#ifdef CONFIG_ACPI
Expand All @@ -3330,6 +3338,7 @@ static __devinit int init_ipmi_si(void)

#ifdef CONFIG_PPC_OF
of_register_platform_driver(&ipmi_of_platform_driver);
of_registered = 1;
#endif

/* We prefer devices with interrupts, but in the case of a machine
Expand Down Expand Up @@ -3383,11 +3392,13 @@ static __devinit int init_ipmi_si(void)
if (unload_when_empty && list_empty(&smi_infos)) {
mutex_unlock(&smi_infos_lock);
#ifdef CONFIG_PCI
pci_unregister_driver(&ipmi_pci_driver);
if (pci_registered)
pci_unregister_driver(&ipmi_pci_driver);
#endif

#ifdef CONFIG_PPC_OF
of_unregister_platform_driver(&ipmi_of_platform_driver);
if (of_registered)
of_unregister_platform_driver(&ipmi_of_platform_driver);
#endif
driver_unregister(&ipmi_driver.driver);
printk(KERN_WARNING PFX
Expand Down Expand Up @@ -3478,14 +3489,16 @@ static __exit void cleanup_ipmi_si(void)
return;

#ifdef CONFIG_PCI
pci_unregister_driver(&ipmi_pci_driver);
if (pci_registered)
pci_unregister_driver(&ipmi_pci_driver);
#endif
#ifdef CONFIG_ACPI
pnp_unregister_driver(&ipmi_pnp_driver);
#endif

#ifdef CONFIG_PPC_OF
of_unregister_platform_driver(&ipmi_of_platform_driver);
if (of_registered)
of_unregister_platform_driver(&ipmi_of_platform_driver);
#endif

mutex_lock(&smi_infos_lock);
Expand Down

0 comments on commit 2613020

Please sign in to comment.