2.4 double PCI unregistration with pcigame
diff mbox series

Message ID 20021201044019.GA965@gondor.apana.org.au
State New, archived
Headers show
Series
  • 2.4 double PCI unregistration with pcigame
Related show

Commit Message

Herbert Xu Dec. 1, 2002, 4:40 a.m. UTC
pcigame.c calls pci_unregister_driver() a second time when it is unloaded
without finding any devices.

Comments

Vojtech Pavlik Dec. 1, 2002, 10:08 a.m. UTC | #1
On Sun, Dec 01, 2002 at 03:40:19PM +1100, Herbert Xu wrote:

> pcigame.c calls pci_unregister_driver() a second time when it is unloaded
> without finding any devices.

I think the proper solution would be:

diff -u -r1.1.1.7 pcigame.c
--- drivers/char/joystick/pcigame.c   28 Nov 2002 23:53:12 -0000 1.1.1.7
+++ drivers/char/joystick/pcigame.c   1 Dec 2002 02:32:08 -0000

@@ -195,7 +195,7 @@

 int __init pcigame_init(void)
 {
-     pci_module_init(&pcigame_driver);
-     /* Needed by other modules */
-     return 0;
+     return pci_module_init(&pcigame_driver);
 }


> -- 
> Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ )
> Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

> Index: drivers/char/joystick/pcigame.c
> ===================================================================
> RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.4/drivers/char/joystick/pcigame.c,v
> retrieving revision 1.1.1.7
> diff -u -r1.1.1.7 pcigame.c
> --- drivers/char/joystick/pcigame.c	28 Nov 2002 23:53:12 -0000	1.1.1.7
> +++ drivers/char/joystick/pcigame.c	1 Dec 2002 02:32:08 -0000
> @@ -195,7 +195,7 @@
>  
>  int __init pcigame_init(void)
>  {
> -	pci_module_init(&pcigame_driver);
> +	pci_register_driver(&pcigame_driver);
>  	/* Needed by other modules */
>  	return 0;
>  }
Herbert Xu Dec. 1, 2002, 10:45 a.m. UTC | #2
On Sun, Dec 01, 2002 at 11:08:08AM +0100, Vojtech Pavlik wrote:
>
> I think the proper solution would be:

This wouldn't work since trident.o requires pcigame.o to work even
though the latter may not discover any devices on its own.  That's
why that comment is there.

> diff -u -r1.1.1.7 pcigame.c
> --- drivers/char/joystick/pcigame.c   28 Nov 2002 23:53:12 -0000 1.1.1.7
> +++ drivers/char/joystick/pcigame.c   1 Dec 2002 02:32:08 -0000
> 
> @@ -195,7 +195,7 @@
> 
>  int __init pcigame_init(void)
>  {
> -     pci_module_init(&pcigame_driver);
> -     /* Needed by other modules */
> -     return 0;
> +     return pci_module_init(&pcigame_driver);
>  }
Vojtech Pavlik Dec. 1, 2002, 10:49 a.m. UTC | #3
On Sun, Dec 01, 2002 at 09:45:02PM +1100, Herbert Xu wrote:

> On Sun, Dec 01, 2002 at 11:08:08AM +0100, Vojtech Pavlik wrote:
> >
> > I think the proper solution would be:
> 
> This wouldn't work since trident.o requires pcigame.o to work even
> though the latter may not discover any devices on its own.  That's
> why that comment is there.

Ok, I agree. Fortunately this mess isn't in 2.5 ...

> > diff -u -r1.1.1.7 pcigame.c
> > --- drivers/char/joystick/pcigame.c   28 Nov 2002 23:53:12 -0000 1.1.1.7
> > +++ drivers/char/joystick/pcigame.c   1 Dec 2002 02:32:08 -0000
> > 
> > @@ -195,7 +195,7 @@
> > 
> >  int __init pcigame_init(void)
> >  {
> > -     pci_module_init(&pcigame_driver);
> > -     /* Needed by other modules */
> > -     return 0;
> > +     return pci_module_init(&pcigame_driver);
> >  }
> -- 
> Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ )
> Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Patch
diff mbox series

Index: drivers/char/joystick/pcigame.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.4/drivers/char/joystick/pcigame.c,v
retrieving revision 1.1.1.7
diff -u -r1.1.1.7 pcigame.c
--- drivers/char/joystick/pcigame.c	28 Nov 2002 23:53:12 -0000	1.1.1.7
+++ drivers/char/joystick/pcigame.c	1 Dec 2002 02:32:08 -0000
@@ -195,7 +195,7 @@ 
 
 int __init pcigame_init(void)
 {
-	pci_module_init(&pcigame_driver);
+	pci_register_driver(&pcigame_driver);
 	/* Needed by other modules */
 	return 0;
 }