lkml.org 
[lkml]   [2000]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: ns558 pci/isa change
Pete Wyckoff wrote:
> i = pci_module_init(&ns558_pci_driver);
> if (i == 0)
> have_pci_devices = 1;
>
> /*
> * Probe for ISA ports.
> */
>
> + i = 0;

you don't want to lose the error code. what you want to do is something
like the attached patch...

--
Jeff Garzik |
Building 1024 | The chief enemy of creativity is "good" sense
MandrakeSoft | -- PicassoIndex: drivers/char/joystick/ns558.c
===================================================================
RCS file: /cvsroot/gkernel/linux_2_4/drivers/char/joystick/ns558.c,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 ns558.c
--- drivers/char/joystick/ns558.c 2000/10/22 23:21:03 1.1.1.3
+++ drivers/char/joystick/ns558.c 2000/11/13 23:51:49
@@ -58,7 +58,6 @@
};

static struct ns558 *ns558;
-static int have_pci_devices;

/*
* ns558_isa_probe() tries to find an isa gameport at the
@@ -316,9 +315,8 @@
* it is the least-invasive probe.
*/

- i = pci_module_init(&ns558_pci_driver);
- if (i == 0)
- have_pci_devices = 1;
+ i = pci_register_driver(&ns558_pci_driver);
+ if (i < 0) return i;

/*
* Probe for ISA ports.
@@ -339,7 +337,7 @@
}
#endif

- return ns558 ? 0 : -ENODEV;
+ return 0;
}

void __exit ns558_exit(void)
@@ -368,8 +366,7 @@
port = port->next;
}

- if (have_pci_devices)
- pci_unregister_driver(&ns558_pci_driver);
+ pci_unregister_driver(&ns558_pci_driver);
}

module_init(ns558_init);
\
 
 \ /
  Last update: 2005-03-22 12:45    [W:0.055 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site