Re: [PATCH] Prevent PCI driver registration failure oopsing

From: Andreas Schwab
Date: Tue Oct 28 2003 - 05:48:46 EST


Russell King <rmk+lkml@xxxxxxxxxxxxxxxx> writes:

> --- 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 ? : 0;

Are you sure you want to return 1 if rc < 0?

Andreas.

--
Andreas Schwab, SuSE Labs, schwab@xxxxxxx
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/