Skip to contentSkip to conversation

initcalls for ATM

PATCH New Christoph Hellwig 1 participant 1 message Oct 9, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 initcalls for ATM

Switch over ATM code to initcalls and reorder the makefile so that link order inside atm is the same. I've also cleaned up
the makefile a bit while at it. I didn't fix the existing
compilation problems in the drivers (cli & friends) and the broken le/be firmware selection for the fore200e cards (kbuild breakage) though.

drivers/atm/Makefile +25 -36
@@ -2,61 +2,50 @@
 # Makefile for the Linux network (ATM) device drivers.
 #
 
-export-objs := uPD98402.o suni.o idt77105.o
+EXTRA_CFLAGS := -g
+
+export-objs	:= uPD98402.o suni.o idt77105.o
+fore_200e-objs	:= fore200e.o
+host-progs	:= fore200e_mkfirm
 
-obj-y := atmdev_init.o
 
-obj-$(CONFIG_ATM_ENI) += eni.o suni.o
-obj-$(CONFIG_ATM_ZATM) += zatm.o uPD98402.o
-obj-$(CONFIG_ATM_NICSTAR) += nicstar.o
-obj-$(CONFIG_ATM_IDT77252) += idt77252.o
+obj-$(CONFIG_ATM_ZATM)		+= zatm.o uPD98402.o
+obj-$(CONFIG_ATM_NICSTAR)	+= nicstar.o
+obj-$(CONFIG_ATM_AMBASSADOR)	+= ambassador.o
+obj-$(CONFIG_ATM_HORIZON)	+= horizon.o
+obj-$(CONFIG_ATM_IA)		+= iphase.o suni.o
+obj-$(CONFIG_ATM_FORE200E)	+= fore_200e.o
+obj-$(CONFIG_ATM_ENI)		+= eni.o suni.o
+obj-$(CONFIG_ATM_IDT77252)	+= idt77252.o
 
 ifeq ($(CONFIG_ATM_NICSTAR_USE_SUNI),y)
-  obj-$(CONFIG_ATM_NICSTAR) += suni.o
+  obj-$(CONFIG_ATM_NICSTAR)	+= suni.o
 endif
-
 ifeq ($(CONFIG_ATM_NICSTAR_USE_IDT77105),y)
-  obj-$(CONFIG_ATM_NICSTAR) += idt77105.o
+  obj-$(CONFIG_ATM_NICSTAR)	+= idt77105.o
 endif
-
 ifeq ($(CONFIG_ATM_IDT77252_USE_SUNI),y)
-  obj-$(CONFIG_ATM_IDT77252) += suni.o
+  obj-$(CONFIG_ATM_IDT77252)	+= suni.o
 endif
 
-obj-$(CONFIG_ATM_HORIZON) += horizon.o
-obj-$(CONFIG_ATM_AMBASSADOR) += ambassador.o
-obj-$(CONFIG_ATM_TCP) += atmtcp.o
-obj-$(CONFIG_ATM_IA) += iphase.o suni.o
-obj-$(CONFIG_ATM_FIRESTREAM) += firestream.o
-obj-$(CONFIG_ATM_LANAI) += lanai.o
+obj-$(CONFIG_ATM_TCP)		+= atmtcp.o
+obj-$(CONFIG_ATM_FIRESTREAM)	+= firestream.o
+obj-$(CONFIG_ATM_LANAI)		+= lanai.o
 
 ifeq ($(CONFIG_ATM_FORE200E_PCA),y)
-  FORE200E_FW_OBJS += fore200e_pca_fw.o
-  ifeq ($(strip $(CONFIG_ATM_FORE200E_PCA_FW)),"")
-    CONFIG_ATM_FORE200E_PCA_DEFAULT_FW := y
-  endif
+  fore_200e-objs		+= fore200e_pca_fw.o
+  # guess the target endianess to choose the right PCA-200E firmware image
   ifeq ($(CONFIG_ATM_FORE200E_PCA_DEFAULT_FW),y)
-#   guess the target endianess to choose the right PCA-200E firmware image
-    CONFIG_ATM_FORE200E_PCA_FW := $(shell if test -n "`$(CC) -E -dM ../../include/asm/byteorder.h | grep ' __LITTLE_ENDIAN '`"; then echo pca200e.bin; else echo pca200e_ecd.bin2; fi)
+    CONFIG_ATM_FORE200E_PCA_FW = $(shell if test -n "`$(CC) -E -dM $(src)/../../include/asm/byteorder.h | grep ' __LITTLE_ENDIAN '`"; then echo pca200e.bin; else echo pca200e_ecd.bin2; fi)
   endif
 endif
+
 ifeq ($(CONFIG_ATM_FORE200E_SBA),y)
-  FORE200E_FW_OBJS += fore200e_sba_fw.o
-  ifeq ($(strip $(CONFIG_ATM_FORE200E_SBA_FW)),"")
-    CONFIG_ATM_FORE200E_SBA_DEFAULT_FW := y
-  endif
+  fore_200e-objs		+= fore200e_sba_fw.o
   ifeq ($(CONFIG_ATM_FORE200E_SBA_DEFAULT_FW),y)
-    CONFIG_ATM_FORE200E_SBA_FW := sba200e_ecd.bin2
+    CONFIG_ATM_FORE200E_SBA_FW	:= sba200e_ecd.bin2
   endif
 endif
-
-obj-$(CONFIG_ATM_FORE200E) += fore_200e.o
-
-fore_200e-objs	:= fore200e.o $(FORE200E_FW_OBJS)
-
-host-progs := fore200e_mkfirm
-
-EXTRA_CFLAGS := -g
 
 include $(TOPDIR)/Rules.make
 

===== drivers/atm/ambassador.c 1.7 vs edited =====

drivers/atm/ambassador.c +4 -38

63 lines not on this page · raw message

===== drivers/atm/fore200e.c 1.10 vs edited =====

drivers/atm/fore200e.c +14 -35

84 lines not on this page · raw message

===== drivers/atm/horizon.c 1.6 vs edited =====

drivers/atm/horizon.c +4 -40

65 lines not on this page · raw message

===== drivers/atm/iphase.c 1.7 vs edited =====

drivers/atm/iphase.c +8 -45

153 lines not on this page · raw message

===== drivers/atm/lanai.c 1.4 vs edited =====

drivers/atm/lanai.c +10 -20
@@ -2882,27 +2882,16 @@
 	return count;
 }
 
-#ifdef MODULE
-static
-#endif
-int __init lanai_detect(void)
+static int __init lanai_module_init(void)
 {
-	return lanai_detect_1(PCI_VENDOR_ID_EF, PCI_VENDOR_ID_EF_ATM_LANAI2) +
-	       lanai_detect_1(PCI_VENDOR_ID_EF, PCI_VENDOR_ID_EF_ATM_LANAIHB);
+	if (lanai_detect_1(PCI_VENDOR_ID_EF, PCI_VENDOR_ID_EF_ATM_LANAI2) +
+	    lanai_detect_1(PCI_VENDOR_ID_EF, PCI_VENDOR_ID_EF_ATM_LANAIHB))
+		return 0;
+	printk(KERN_ERR DEV_LABEL ": no adaptor found\n");
+	return -ENODEV;
 }
 
-#ifdef MODULE
-
-int init_module(void)
-{
-	if (lanai_detect() == 0) {
-		printk(KERN_ERR DEV_LABEL ": no adaptor found\n");
-		return -ENODEV;
-	}
-	return 0;
-}
-
-void cleanup_module(void)
+static void __exit lanai_module_exit(void)
 {
 	/* We'll only get called when all the interfaces are already
 	 * gone, so there isn't much to do
@@ -2910,8 +2899,9 @@
 	DPRINTK("cleanup_module()\n");
 }
 
+module_init(lanai_module_init);
+module_exit(lanai_module_exit);
+
 MODULE_AUTHOR("Mitchell Blank Jr <[email protected]>");
 MODULE_DESCRIPTION("Efficient Networks Speedstream 3010 driver");
 MODULE_LICENSE("GPL");
-
-#endif /* MODULE */

===== drivers/atm/nicstar.c 1.9 vs edited =====

drivers/atm/nicstar.c +7 -60

99 lines not on this page · raw message

===== drivers/atm/zatm.c 1.7 vs edited =====

drivers/atm/zatm.c +8 -27
@@ -1806,8 +1806,7 @@
 	.change_qos	= zatm_change_qos,
 };
 
-
-int __init zatm_detect(void)
+static int __init zatm_module_init(void)
 {
 	struct atm_dev *dev;
 	struct zatm_dev *zatm_dev;
@@ -1841,36 +1840,18 @@
 			    zatm_dev),GFP_KERNEL);
 			if (!zatm_dev) {
 				printk(KERN_EMERG "zatm.c: memory shortage\n");
-				return devs;
+				goto out;
 			}
 		}
 	}
+out:
 	kfree(zatm_dev);
-	return devs;
-}
-
 
-#ifdef MODULE
- 
-MODULE_LICENSE("GPL");
-
-int init_module(void)
-{
-	if (!zatm_detect()) {
-		printk(KERN_ERR DEV_LABEL ": no adapter found\n");
-		return -ENXIO;
-	}
+	/* XXX: currently the driver is not unloadable.. */
 	MOD_INC_USE_COUNT;
 	return 0;
 }
- 
- 
-void cleanup_module(void)
-{
-	/*
-	 * Well, there's no way to get rid of the driver yet, so we don't
-	 * have to clean up, right ? :-)
-	 */
-}
- 
-#endif
+
+MODULE_LICENSE("GPL");
+
+module_init(zatm_module_init);

===== drivers/block/genhd.c 1.43 vs edited =====

drivers/block/genhd.c +0 -8
@@ -217,14 +217,6 @@
 	for (i = 0; i < MAX_BLKDEV; i++)
 		INIT_LIST_HEAD(&gendisks[i].list);
 	blk_dev_init();
-#ifdef CONFIG_FC4_SOC
-	/* This has to be done before scsi_dev_init */
-	soc_probe();
-#endif
-#ifdef CONFIG_ATM
-	(void) atmdev_init();
-#endif
-
 	devclass_register(&disk_devclass);
 	return 0;
 }