[PATCH 2.6.11.7] sbpcd init cleanup and fix

From: Ross Kendall Axe
Date: Sun Apr 17 2005 - 16:49:14 EST


- 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@xxxxxxxxxxxxxxxx>
--- 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: signature.asc
Description: OpenPGP digital signature