aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 3f2a4900fe1..9b9e1e915cf 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -3298,6 +3298,14 @@ static __devinit int init_ipmi_si(void)
3298 3298
3299 hardcode_find_bmc(); 3299 hardcode_find_bmc();
3300 3300
3301 /* If the user gave us a device, they presumably want us to use it */
3302 mutex_lock(&smi_infos_lock);
3303 if (!list_empty(&smi_infos)) {
3304 mutex_unlock(&smi_infos_lock);
3305 return 0;
3306 }
3307 mutex_unlock(&smi_infos_lock);
3308
3301#ifdef CONFIG_DMI 3309#ifdef CONFIG_DMI
3302 dmi_find_bmc(); 3310 dmi_find_bmc();
3303#endif 3311#endif
@@ -3321,10 +3329,27 @@ static __devinit int init_ipmi_si(void)
3321 of_register_platform_driver(&ipmi_of_platform_driver); 3329 of_register_platform_driver(&ipmi_of_platform_driver);
3322#endif 3330#endif
3323 3331
3332 /* Try to register something with interrupts first */
3333
3324 mutex_lock(&smi_infos_lock); 3334 mutex_lock(&smi_infos_lock);
3325 list_for_each_entry(e, &smi_infos, link) { 3335 list_for_each_entry(e, &smi_infos, link) {
3326 if (!e->si_sm) 3336 if (e->irq) {
3327 try_smi_init(e); 3337 if (!try_smi_init(e)) {
3338 mutex_unlock(&smi_infos_lock);
3339 return 0;
3340 }
3341 }
3342 }
3343
3344 /* Fall back to the preferred device */
3345
3346 list_for_each_entry(e, &smi_infos, link) {
3347 if (!e->irq) {
3348 if (!try_smi_init(e)) {
3349 mutex_unlock(&smi_infos_lock);
3350 return 0;
3351 }
3352 }
3328 } 3353 }
3329 mutex_unlock(&smi_infos_lock); 3354 mutex_unlock(&smi_infos_lock);
3330 3355