linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Andreas Schwab <schwab@suse.de>
Cc: Greg KH <greg@kroah.com>,
	Linux Kernel List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Prevent PCI driver registration failure oopsing
Date: Tue, 28 Oct 2003 10:51:26 +0000	[thread overview]
Message-ID: <20031028105126.I22424@flint.arm.linux.org.uk> (raw)
In-Reply-To: <jehe1tvdsq.fsf@sykes.suse.de>; from schwab@suse.de on Tue, Oct 28, 2003 at 11:48:05AM +0100

On Tue, Oct 28, 2003 at 11:48:05AM +0100, Andreas Schwab wrote:
> Russell King <rmk+lkml@arm.linux.org.uk> writes:
> > +	return rc < 0 ? : 0;
> 
> Are you sure you want to return 1 if rc < 0?

Argh.  Definitely not.  Thanks for spotting that.

--- orig/include/linux/pci.h	Thu Mar 13 14:24:56 2003
+++ linux/include/linux/pci.h	Wed Mar 12 19:37:41 2003
@@ -768,26 +768,7 @@
 {
 	int rc = pci_register_driver (drv);
 
-	if (rc > 0)
-		return 0;
-
-	/* iff CONFIG_HOTPLUG and built into kernel, we should
-	 * leave the driver around for future hotplug events.
-	 * For the module case, a hotplug daemon of some sort
-	 * should load a module in response to an insert event. */
-#if defined(CONFIG_HOTPLUG) && !defined(MODULE)
-	if (rc == 0)
-		return 0;
-#else
-	if (rc == 0)
-		rc = -ENODEV;		
-#endif
-
-	/* if we get here, we need to clean up pci driver instance
-	 * and return some sort of error */
-	pci_unregister_driver (drv);
-	
-	return rc;
+	return rc < 0 ? rc : 0;
 }
 
 /*



-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core

  reply	other threads:[~2003-10-28 10:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-28 10:04 [PATCH] Prevent PCI driver registration failure oopsing Russell King
2003-10-28 10:48 ` Andreas Schwab
2003-10-28 10:51   ` Russell King [this message]
2003-10-29 23:30     ` Greg KH

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=20031028105126.I22424@flint.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwab@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).