Skip to contentSkip to conversation

remove drivers/mca/mca-proc.c

RFC PATCH New Adrian Bunk 1 participant 1 message Nov 23, 2005

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

RFC PATCH 1/1 remove drivers/mca/mca-proc.c

Do we really need an additional proc interface for the few drivers still using the obsolete old MCA API?

This patch removes drivers/mca/mca-proc.c and does the cleanups that are possible after this removal.

---

 arch/i386/kernel/mca.c          |    2 
 arch/i386/kernel/setup.c        |   12 -
 drivers/block/ps2esdi.c         |    3 
 drivers/mca/Kconfig             |    6 
 drivers/mca/Makefile            |    1 
 drivers/mca/mca-device.c        |   17 --
 drivers/mca/mca-legacy.c        |    2 
 drivers/mca/mca-proc.c          |  249 --------------------------------
 drivers/net/3c523.c             |   34 ----
 drivers/net/eexpress.c          |    1 
 drivers/net/ibmlana.c           |   33 ----
 drivers/net/ne2.c               |   27 ---
 drivers/net/sk_mca.c            |    3 
 drivers/net/tokenring/madgemc.c |   47 ------
 drivers/scsi/aha1542.c          |    1 
 drivers/scsi/ibmmca.c           |   55 -------
 include/asm-i386/bugs.h         |    8 -
 include/asm-i386/processor.h    |    7 
 include/linux/mca.h             |   24 ---
drivers/mca/Kconfig renamed from drivers/mca/Kconfig.old +0 -6
@@ -6,9 +6,3 @@
 	  have an unconverted MCA driver, you will need to say Y here.  It
 	  is safe to say Y anyway.
 
-config MCA_PROC_FS
-	bool "Support for the mca entry in /proc"
-	depends on MCA_LEGACY && PROC_FS
-	help
-	  If you want the old style /proc/mca directory in addition to the
-	  new style sysfs say Y here.
drivers/mca/Makefile renamed from drivers/mca/Makefile.old +0 -1
@@ -2,6 +2,5 @@
 
 obj-y	:= mca-bus.o mca-device.o mca-driver.o
 
-obj-$(CONFIG_MCA_PROC_FS)	+= mca-proc.o
 obj-$(CONFIG_MCA_LEGACY)	+= mca-legacy.o
 
include/linux/mca.h renamed from include/linux/mca.h.old +0 -24
@@ -58,14 +58,6 @@
 	short			pos_register;
 	
 	enum MCA_AdapterStatus	status;
-#ifdef CONFIG_MCA_PROC_FS
-	/* name of the proc/mca file */
-	char			procname[8];
-	/* /proc info callback */
-	MCA_ProcFn		procfn;
-	/* device/context info for proc callback */
-	void			*proc_dev;
-#endif
 	struct device		dev;
 	char			name[32];
 };
@@ -99,7 +91,6 @@
 #define to_mca_driver(mdriver) container_of(mdriver, struct mca_driver, driver)
 
 /* Ongoing supported API functions */
-extern struct mca_device *mca_find_device_by_slot(int slot);
 extern int mca_system_init(void);
 extern struct mca_bus *mca_attach_bus(int);
 
@@ -120,8 +111,6 @@
 	return mca_dev ? mca_dev->name : NULL;
 }
 
-extern enum MCA_AdapterStatus mca_device_status(struct mca_device *mca_dev);
-
 extern struct bus_type mca_bus_type;
 
 extern int mca_register_driver(struct mca_driver *drv);
@@ -130,17 +119,4 @@
 /* WARNING: only called by the boot time device setup */
 extern int mca_register_device(int bus, struct mca_device *mca_dev);
 
-#ifdef CONFIG_MCA_PROC_FS
-extern void mca_do_proc_init(void);
-extern void mca_set_adapter_procfn(int slot, MCA_ProcFn, void* dev);
-#else
-static inline void mca_do_proc_init(void)
-{
-}
-
-static inline void mca_set_adapter_procfn(int slot, MCA_ProcFn fn, void* dev)
-{
-}
-#endif
-
 #endif /* _LINUX_MCA_H */
drivers/mca/mca-legacy.c renamed from drivers/mca/mca-legacy.c.old +1 -1
@@ -169,7 +169,7 @@
 	return 0;
 }
 
-struct mca_device *mca_find_device_by_slot(int slot)
+static struct mca_device *mca_find_device_by_slot(int slot)
 {
 	struct mca_find_device_by_slot_info info;
 
drivers/mca/mca-device.c renamed from drivers/mca/mca-device.c.old +0 -17
@@ -187,23 +187,6 @@
 EXPORT_SYMBOL(mca_device_set_claim);
 
 /**
- *	mca_device_status - get the status of the device
- *	@mca_device:	device to get
- *
- *	returns an enumeration of the device status:
- *
- *	MCA_ADAPTER_NORMAL	adapter is OK.
- *	MCA_ADAPTER_NONE	no adapter at device (should never happen).
- *	MCA_ADAPTER_DISABLED	adapter is disabled.
- *	MCA_ADAPTER_ERROR	adapter cannot be initialised.
- */
-enum MCA_AdapterStatus mca_device_status(struct mca_device *mca_dev)
-{
-	return mca_dev->status;
-}
-EXPORT_SYMBOL(mca_device_status);
-
-/**
  *	mca_device_set_name - set the name of the device
  *	@mca_device:	device to set the name of
  *	@name:		name to set
include/asm-i386/processor.h renamed from include/asm-i386/processor.h.old +0 -7
@@ -301,13 +301,6 @@
 		: :"a" (eax), "c" (ecx));
 }
 
-/* from system description table in BIOS.  Mostly for MCA use, but
-others may find it useful. */
-extern unsigned int machine_id;
-extern unsigned int machine_submodel_id;
-extern unsigned int BIOS_revision;
-extern unsigned int mca_pentium_flag;
-
 /* Boot loader type from the setup header */
 extern int bootloader_type;
 
include/asm-i386/bugs.h renamed from include/asm-i386/bugs.h.old +0 -8
@@ -44,14 +44,6 @@
 
 __setup("no-hlt", no_halt);
 
-static int __init mca_pentium(char *s)
-{
-	mca_pentium_flag = 1;
-	return 1;
-}
-
-__setup("mca-pentium", mca_pentium);
-
 static int __init no_387(char *s)
 {
 	boot_cpu_data.hard_math = 0;
arch/i386/kernel/mca.c renamed from arch/i386/kernel/mca.c.old +0 -2
@@ -400,8 +400,6 @@
 	for (i = 0; i < MCA_STANDARD_RESOURCES; i++)
 		request_resource(&ioport_resource, mca_standard_resources + i);
 
-	mca_do_proc_init();
-
 	return 0;
 
  out_unlock_nomem:
arch/i386/kernel/setup.c renamed from arch/i386/kernel/setup.c.old +0 -12
@@ -99,15 +99,6 @@
 extern acpi_interrupt_flags	acpi_sci_flags;
 #endif
 
-/* for MCA, but anyone else can use it if they want */
-unsigned int machine_id;
-#ifdef CONFIG_MCA
-EXPORT_SYMBOL(machine_id);
-#endif
-unsigned int machine_submodel_id;
-unsigned int BIOS_revision;
-unsigned int mca_pentium_flag;
-
 /* For PCI or other memory-mapped resources */
 unsigned long pci_mem_start = 0x10000000;
 #ifdef CONFIG_PCI
@@ -1519,9 +1510,6 @@
 	saved_videomode = VIDEO_MODE;
 	if( SYS_DESC_TABLE.length != 0 ) {
 		set_mca_bus(SYS_DESC_TABLE.table[3] & 0x2);
-		machine_id = SYS_DESC_TABLE.table[0];
-		machine_submodel_id = SYS_DESC_TABLE.table[1];
-		BIOS_revision = SYS_DESC_TABLE.table[2];
 	}
 	bootloader_type = LOADER_TYPE;
 
drivers/block/ps2esdi.c renamed from drivers/block/ps2esdi.c.old +0 -3
@@ -205,7 +205,6 @@
 	int i;
 	if(ps2esdi_slot) {
 		mca_mark_as_unused(ps2esdi_slot);
-		mca_set_adapter_procfn(ps2esdi_slot, NULL, NULL);
 	}
 	release_region(io_base, 4);
 	free_dma(dma_arb_level);
@@ -313,7 +312,6 @@
 
 	ps2esdi_slot = slot;
 	mca_mark_as_used(slot);
-	mca_set_adapter_procfn(slot, (MCA_ProcFn) ps2esdi_getinfo, NULL);
 
 	/* Found the slot - read the POS register 2 to get the necessary
 	   configuration and status information.  POS register 2 has the
@@ -444,7 +442,6 @@
 err_out1:
 	if(ps2esdi_slot) {
 		mca_mark_as_unused(ps2esdi_slot);
-		mca_set_adapter_procfn(ps2esdi_slot, NULL, NULL);
 	}
 	return error;
 }
drivers/net/3c523.c renamed from drivers/net/3c523.c.old +0 -34
@@ -379,37 +379,6 @@
 
 /*****************************************************************/
 
-static int elmc_getinfo(char *buf, int slot, void *d)
-{
-	int len = 0;
-	struct net_device *dev = (struct net_device *) d;
-	int i;
-
-	if (dev == NULL)
-		return len;
-
-	len += sprintf(buf + len, "Revision: 0x%x\n",
-		       inb(dev->base_addr + ELMC_REVISION) & 0xf);
-	len += sprintf(buf + len, "IRQ: %d\n", dev->irq);
-	len += sprintf(buf + len, "IO Address: %#lx-%#lx\n", dev->base_addr,
-		       dev->base_addr + ELMC_IO_EXTENT);
-	len += sprintf(buf + len, "Memory: %#lx-%#lx\n", dev->mem_start,
-		       dev->mem_end - 1);
-	len += sprintf(buf + len, "Transceiver: %s\n", dev->if_port ?
-		       "External" : "Internal");
-	len += sprintf(buf + len, "Device: %s\n", dev->name);
-	len += sprintf(buf + len, "Hardware Address:");
-	for (i = 0; i < 6; i++) {
-		len += sprintf(buf + len, " %02x", dev->dev_addr[i]);
-	}
-	buf[len++] = '\n';
-	buf[len] = 0;
-
-	return len;
-}				/* elmc_getinfo() */
-
-/*****************************************************************/
-
 static int __init do_elmc_probe(struct net_device *dev)
 {
 	static int slot;
@@ -459,7 +428,6 @@
 		return ((base_addr || irq) ? -ENXIO : -ENODEV);
 
 	mca_set_adapter_name(slot, "3Com 3c523 Etherlink/MC");
-	mca_set_adapter_procfn(slot, (MCA_ProcFn) elmc_getinfo, dev);
 
 	/* if we get this far, adapter has been found - carry on */
 	printk(KERN_INFO "%s: 3c523 adapter found in slot %d\n", dev->name, slot + 1);
@@ -578,14 +546,12 @@
 
 	return 0;
 err_out:
-	mca_set_adapter_procfn(slot, NULL, NULL);
 	release_region(dev->base_addr, ELMC_IO_EXTENT);
 	return retval;
 }
  
 static void cleanup_card(struct net_device *dev)
 {
-	mca_set_adapter_procfn(((struct priv *) (dev->priv))->slot, NULL, NULL);
 	release_region(dev->base_addr, ELMC_IO_EXTENT);
 }
 
drivers/net/eexpress.c renamed from drivers/net/eexpress.c.old +0 -1
@@ -385,7 +385,6 @@
 			}
 
 			mca_set_adapter_name(slot, "Intel EtherExpress 16 MCA");
-			mca_set_adapter_procfn(slot, NULL, dev);
 			mca_mark_as_used(slot);
 
 			break;
drivers/net/ibmlana.c renamed from drivers/net/ibmlana.c.old +0 -33
@@ -743,36 +743,6 @@
  * driver methods
  * ------------------------------------------------------------------------ */
 
-/* MCA info */
-
-static int ibmlana_getinfo(char *buf, int slot, void *d)
-{
-	int len = 0, i;
-	struct net_device *dev = (struct net_device *) d;
-	ibmlana_priv *priv;
-
-	/* can't say anything about an uninitialized device... */
-
-	if (dev == NULL)
-		return len;
-	priv = netdev_priv(dev);
-
-	/* print info */
-
-	len += sprintf(buf + len, "IRQ: %d\n", priv->realirq);
-	len += sprintf(buf + len, "I/O: %#lx\n", dev->base_addr);
-	len += sprintf(buf + len, "Memory: %#lx-%#lx\n", dev->mem_start, dev->mem_end - 1);
-	len += sprintf(buf + len, "Transceiver: %s\n", MediaNames[priv->medium]);
-	len += sprintf(buf + len, "Device: %s\n", dev->name);
-	len += sprintf(buf + len, "MAC address:");
-	for (i = 0; i < 6; i++)
-		len += sprintf(buf + len, " %02x", dev->dev_addr[i]);
-	buf[len++] = '\n';
-	buf[len] = 0;
-
-	return len;
-}
-
 /* open driver.  Means also initialization and start of LANCE */
 
 static int ibmlana_open(struct net_device *dev)
@@ -971,7 +941,6 @@
 
 	/* make procfs entries */
 	mca_set_adapter_name(slot, "IBM LAN Adapter/A");
-	mca_set_adapter_procfn(slot, (MCA_ProcFn) ibmlana_getinfo, dev);
 
 	mca_mark_as_used(slot);
 
@@ -1049,7 +1018,6 @@
 			release_region(dev->base_addr, IBM_LANA_IORANGE);
 			mca_mark_as_unused(priv->slot);
 			mca_set_adapter_name(priv->slot, "");
-			mca_set_adapter_procfn(priv->slot, NULL, NULL);
 			iounmap(priv->base);
 			free_netdev(dev);
 			break;
@@ -1071,7 +1039,6 @@
 			release_region(dev->base_addr, IBM_LANA_IORANGE);
 			mca_mark_as_unused(priv->slot);
 			mca_set_adapter_name(priv->slot, "");
-			mca_set_adapter_procfn(priv->slot, NULL, NULL);
 			iounmap(priv->base);
 			free_netdev(dev);
 		}
drivers/net/ne2.c renamed from drivers/net/ne2.c.old +0 -27
@@ -281,7 +281,6 @@
 static void cleanup_card(struct net_device *dev)
 {
 	mca_mark_as_unused(ei_status.priv);
-	mca_set_adapter_procfn( ei_status.priv, NULL, NULL);
 	free_irq(dev->irq, dev);
 	release_region(dev->base_addr, NE_IO_EXTENT);
 }
@@ -308,29 +307,6 @@
 }
 #endif
 
-static int ne2_procinfo(char *buf, int slot, struct net_device *dev)
-{
-	int len=0;
-
-	len += sprintf(buf+len, "The NE/2 Ethernet Adapter\n" );
-	len += sprintf(buf+len, "Driver written by Wim Dumon ");
-	len += sprintf(buf+len, "<[email protected]>\n"); 
-	len += sprintf(buf+len, "Modified by ");
-	len += sprintf(buf+len, "David Weinehall <[email protected]>\n");
-	len += sprintf(buf+len, "and by Magnus Jonsson <[email protected]>\n");
-	len += sprintf(buf+len, "Based on the original NE2000 drivers\n" );
-	len += sprintf(buf+len, "Base IO: %#x\n", (unsigned int)dev->base_addr);
-	len += sprintf(buf+len, "IRQ    : %d\n", dev->irq);
-
-#define HW_ADDR(i) dev->dev_addr[i]
-	len += sprintf(buf+len, "HW addr : %x:%x:%x:%x:%x:%x\n", 
-			HW_ADDR(0), HW_ADDR(1), HW_ADDR(2), 
-			HW_ADDR(3), HW_ADDR(4), HW_ADDR(5) );
-#undef HW_ADDR
-
-	return len;
-}
-
 static int __init ne2_probe1(struct net_device *dev, int slot)
 {
 	int i, base_addr, irq, retval;
@@ -486,8 +462,6 @@
 	printk("\n%s: %s found at %#x, using IRQ %d.\n",
 			dev->name, name, base_addr, dev->irq);
 
-	mca_set_adapter_procfn(slot, (MCA_ProcFn) ne2_procinfo, dev);
-
 	ei_status.name = name;
 	ei_status.tx_start_page = start_page;
 	ei_status.stop_page = stop_page;
@@ -518,7 +492,6 @@
 		goto out1;
 	return 0;
 out1:
-	mca_set_adapter_procfn( ei_status.priv, NULL, NULL);
 	free_irq(dev->irq, dev);
 out:
 	release_region(base_addr, NE_IO_EXTENT);
drivers/net/sk_mca.c renamed from drivers/net/sk_mca.c.old +0 -3
@@ -1016,7 +1016,6 @@
 		free_irq(dev->irq, dev);
 	iounmap(priv->base);
 	mca_mark_as_unused(priv->slot);
-	mca_set_adapter_procfn(priv->slot, NULL, NULL);
 }
 
 struct net_device * __init skmca_probe(int unit)
@@ -1090,7 +1089,6 @@
 				     "SKNET junior MC2 Ethernet Adapter");
 	else
 		mca_set_adapter_name(slot, "SKNET MC2+ Ethernet Adapter");
-	mca_set_adapter_procfn(slot, (MCA_ProcFn) skmca_getinfo, dev);
 
 	mca_mark_as_used(slot);
 
@@ -1101,7 +1099,6 @@
 	priv = netdev_priv(dev);
 	priv->base = ioremap(base, 0x4000);
 	if (!priv->base) {
-		mca_set_adapter_procfn(slot, NULL, NULL);
 		mca_mark_as_unused(slot);
 		free_netdev(dev);
 		return ERR_PTR(-ENOMEM);
drivers/net/tokenring/madgemc.c renamed from drivers/net/tokenring/madgemc.c.old +0 -47

65 lines not on this page · raw message

drivers/scsi/aha1542.c renamed from drivers/scsi/aha1542.c.old +0 -1
@@ -1116,7 +1116,6 @@
 			printk(KERN_INFO "Found an AHA-1640 in MCA slot %d, I/O 0x%04x\n", slot, bases[indx]);
 
 			mca_set_adapter_name(slot, "Adapter AHA-1640");
-			mca_set_adapter_procfn(slot, NULL, NULL);
 			mca_mark_as_used(slot);
 			
 			/* Go on */
drivers/scsi/ibmmca.c renamed from drivers/scsi/ibmmca.c.old +0 -55

85 lines not on this page · raw message

drivers/mca/mca-proc.c deleted +0 -249

249 lines not on this page · raw message