mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] eisa: do not force probe if cannot allocate resource on mainboard
@ 2011-05-19 20:52 Eduardo Silva
  0 siblings, 0 replies; only message in thread
From: Eduardo Silva @ 2011-05-19 20:52 UTC (permalink / raw)
  To: Marc Zyngier, Greg KH; +Cc: linux-kernel

if the eisa_probe() function fails to allocate resource for the
mainboard in question, it performs a force probe over the available
slots and print all fails in the logs. e.g:

[    1.264550] EISA: Cannot allocate resource for mainboard
[    1.264552] Cannot allocate resource for EISA slot 1
[    1.264554] Cannot allocate resource for EISA slot 2
[    1.264556] Cannot allocate resource for EISA slot 3
[    1.264557] Cannot allocate resource for EISA slot 4
[    1.264559] Cannot allocate resource for EISA slot 5
[    1.264561] Cannot allocate resource for EISA slot 6
[    1.264563] Cannot allocate resource for EISA slot 7
[    1.264564] Cannot allocate resource for EISA slot 8
[    1.264566] EISA: Detected 0 cards.

The force probe for this specific condition always fails. The
patch make it to skip the force probe and print a more detailed ending
message to the log adding the number available slots:

[    1.264550] EISA: Cannot allocate resource for mainboard
[    1.264566] EISA: Detected 0 cards in 8 slots.

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
---
 drivers/eisa/eisa-bus.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/eisa/eisa-bus.c b/drivers/eisa/eisa-bus.c
index 806c77b..1cf37e0 100644
--- a/drivers/eisa/eisa-bus.c
+++ b/drivers/eisa/eisa-bus.c
@@ -312,7 +312,7 @@ static void __init eisa_release_resources(struct eisa_device *edev)
 
 static int __init eisa_probe(struct eisa_root_device *root)
 {
-        int i, c;
+        int i, c = 0;
 	struct eisa_device *edev;
 
 	printk(KERN_INFO "EISA: Probing bus %d at %s\n",
@@ -333,7 +333,7 @@ static int __init eisa_probe(struct eisa_root_device *root)
 		kfree(edev);
 		if (!root->force_probe)
 			return -EBUSY;
-		goto force_probe;
+		goto out;
 	}
 
 	if (eisa_init_device(root, edev, 0)) {
@@ -355,7 +355,7 @@ static int __init eisa_probe(struct eisa_root_device *root)
 	
  force_probe:
 	
-        for (c = 0, i = 1; i <= root->slots; i++) {
+        for (i = 1; i <= root->slots; i++) {
 		edev = kzalloc(sizeof(*edev), GFP_KERNEL);
 		if (!edev) {
 			printk(KERN_ERR "EISA: Out of memory for slot %d\n", i);
@@ -405,7 +405,9 @@ static int __init eisa_probe(struct eisa_root_device *root)
 		}
         }
 
-	printk(KERN_INFO "EISA: Detected %d card%s.\n", c, c == 1 ? "" : "s");
+ out:
+	printk(KERN_INFO "EISA: Detected %d card%s in %d slots.\n", c,
+	       c == 1 ? "" : "s", root->slots);
 
 	return 0;
 }
-- 
1.7.4.1





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-05-19 21:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-19 20:52 [PATCH] eisa: do not force probe if cannot allocate resource on mainboard Eduardo Silva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®