mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eduardo Silva <edsiper@gmail.com>
To: Marc Zyngier <maz@wild-wind.fr.eu.org>, Greg KH <gregkh@suse.de>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] eisa: do not force probe if cannot allocate resource on mainboard
Date: Thu, 19 May 2011 16:52:36 -0400	[thread overview]
Message-ID: <1305838356.5272.5.camel@monotop> (raw)

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





                 reply	other threads:[~2011-05-19 21:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1305838356.5272.5.camel@monotop \
    --to=edsiper@gmail.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@wild-wind.fr.eu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®