lkml.org 
[lkml]   [2001]   [Feb]   [14]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateWed, 14 Feb 2001 05:14:19 -0600 (CST)
FromJeff Garzik <>
SubjectRe: [patch] 2.4.2-pre3: parport_pc init_module bug
On Wed, 14 Feb 2001, Tim Waugh wrote:

> On Wed, Feb 14, 2001 at 02:03:07AM -0600, Jeff Garzik wrote:
> 
> > If pci_register_driver returns < 0, the driver is not registered with
> > the system.
> 
> Thanks.  Okay, second try:
> 
> 2001-01-14  Tim Waugh  <twaugh@redhat.com>
> 
> 	* parport_pc.c: Fix PCI driver list corruption on
> 	unsuccessful module load (Andrew Morton).
> 
> --- linux/drivers/parport/parport_pc.c.init	Wed Feb 14 10:49:28 2001
> +++ linux/drivers/parport/parport_pc.c	Wed Feb 14 10:50:31 2001
> @@ -89,6 +89,7 @@
>  } superios[NR_SUPERIOS] __devinitdata = { {0,},};
> 
>  static int user_specified __devinitdata = 0;
> +static int registered_parport;
> 
>  /* frob_control, but for ECR */
>  static void frob_econtrol (struct parport *pb, unsigned char m,
> @@ -2605,8 +2606,10 @@
>  	count += parport_pc_find_nonpci_ports (autoirq, autodma);
> 
>  	r = pci_register_driver (&parport_pc_pci_driver);
> -	if (r > 0)
> +	if (r >= 0) {
> +		registered_parport = 1;
>  		count += r;
> +	}
> 
>  	return count;
>  }

Should the call to pci_unregister_driver in cleanup_module be
conditional on registered_parport as well?  I didn't check...

Also, is it possible to convert parport_pc to new-style module_init()?

	Jeff




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:14    [W:3.264 / U:0.060 seconds]
©2003-2008 Jasper Spaans