* [PATCH 2.6.11.7] sbpcd init cleanup and fix
@ 2005-04-17 22:49 Ross Kendall Axe
0 siblings, 0 replies; only message in thread
From: Ross Kendall Axe @ 2005-04-17 22:49 UTC (permalink / raw)
To: emoenke; +Cc: linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 322 bytes --]
- Remove ugly '#ifdef MODULE's
- Use the __exit attribute on sbpcd_exit()
- Don't rename sbpcd_init() to __sbpcd_init() in modules
- Make sbpcd_init() and sbpcd_exit() static
- Ensure sbpcd_init() is actually called when the driver is compiled in
to the kernel
Signed-off-by: Ross Kendall Axe <ross.axe@blueyonder.co.uk>
[-- Attachment #1.2: linux-2.6.11.7-sbpcd-init.patch --]
[-- Type: text/x-patch, Size: 993 bytes --]
--- linux-2.6.11.7/drivers/cdrom/sbpcd.c.orig 2005-04-13 17:12:29.000000000 +0100
+++ linux-2.6.11.7/drivers/cdrom/sbpcd.c 2005-04-13 17:46:29.000000000 +0100
@@ -5639,11 +5639,7 @@ static int __init config_spea(void)
*/
/* FIXME: cleanups after failed allocations are too ugly for words */
-#ifdef MODULE
-int __init __sbpcd_init(void)
-#else
-int __init sbpcd_init(void)
-#endif
+static int __init sbpcd_init(void)
{
int i=0, j=0;
int addr[2]={1, CDROM_PORT};
@@ -5894,8 +5890,7 @@ int __init sbpcd_init(void)
return 0;
}
/*==========================================================================*/
-#ifdef MODULE
-void sbpcd_exit(void)
+static void __exit sbpcd_exit(void)
{
int j;
@@ -5926,11 +5921,10 @@ void sbpcd_exit(void)
}
-module_init(__sbpcd_init) /*HACK!*/;
+module_init(sbpcd_init);
module_exit(sbpcd_exit);
-#endif /* MODULE */
static int sbpcd_media_changed(struct cdrom_device_info *cdi, int disc_nr)
{
struct sbpcd_drive *p = cdi->handle;
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-04-17 21:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-17 22:49 [PATCH 2.6.11.7] sbpcd init cleanup and fix Ross Kendall Axe
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.