From: Adrian Bunk 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. Signed-off-by: Adrian Bunk Cc: James Bottomley Signed-off-by: Andrew Morton --- dev/null | 249 ------------------------------ 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/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 -- 19 files changed, 1 insertion(+), 531 deletions(-) diff -puN arch/i386/kernel/mca.c~remove-drivers-mca-mca-procc arch/i386/kernel/mca.c --- devel/arch/i386/kernel/mca.c~remove-drivers-mca-mca-procc 2006-01-31 18:37:27.000000000 -0800 +++ devel-akpm/arch/i386/kernel/mca.c 2006-01-31 18:37:27.000000000 -0800 @@ -400,8 +400,6 @@ static int __init mca_init(void) 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: diff -puN arch/i386/kernel/setup.c~remove-drivers-mca-mca-procc arch/i386/kernel/setup.c --- devel/arch/i386/kernel/setup.c~remove-drivers-mca-mca-procc 2006-01-31 18:37:27.000000000 -0800 +++ devel-akpm/arch/i386/kernel/setup.c 2006-01-31 18:37:27.000000000 -0800 @@ -100,15 +100,6 @@ int __initdata acpi_force = 0; 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 @@ -1424,9 +1415,6 @@ void __init setup_arch(char **cmdline_p) 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; diff -puN drivers/block/ps2esdi.c~remove-drivers-mca-mca-procc drivers/block/ps2esdi.c --- devel/drivers/block/ps2esdi.c~remove-drivers-mca-mca-procc 2006-01-31 18:37:27.000000000 -0800 +++ devel-akpm/drivers/block/ps2esdi.c 2006-01-31 18:37:27.000000000 -0800 @@ -206,7 +206,6 @@ cleanup_module(void) { 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); @@ -314,7 +313,6 @@ static int __init ps2esdi_geninit(void) 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 @@ -445,7 +443,6 @@ err_out2: err_out1: if(ps2esdi_slot) { mca_mark_as_unused(ps2esdi_slot); - mca_set_adapter_procfn(ps2esdi_slot, NULL, NULL); } return error; } diff -puN drivers/mca/Kconfig~remove-drivers-mca-mca-procc drivers/mca/Kconfig --- devel/drivers/mca/Kconfig~remove-drivers-mca-mca-procc 2006-01-31 18:37:27.000000000 -0800 +++ devel-akpm/drivers/mca/Kconfig 2006-01-31 18:37:27.000000000 -0800 @@ -6,9 +6,3 @@ config MCA_LEGACY 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. diff -puN drivers/mca/Makefile~remove-drivers-mca-mca-procc drivers/mca/Makefile --- devel/drivers/mca/Makefile~remove-drivers-mca-mca-procc 2006-01-31 18:37:27.000000000 -0800 +++ devel-akpm/drivers/mca/Makefile 2006-01-31 18:37:27.000000000 -0800 @@ -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 diff -puN drivers/mca/mca-device.c~remove-drivers-mca-mca-procc drivers/mca/mca-device.c --- devel/drivers/mca/mca-device.c~remove-drivers-mca-mca-procc 2006-01-31 18:37:27.000000000 -0800 +++ devel-akpm/drivers/mca/mca-device.c 2006-01-31 18:37:27.000000000 -0800 @@ -187,23 +187,6 @@ void mca_device_set_claim(struct mca_dev 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 diff -puN drivers/mca/mca-legacy.c~remove-drivers-mca-mca-procc drivers/mca/mca-legacy.c --- devel/drivers/mca/mca-legacy.c~remove-drivers-mca-mca-procc 2006-01-31 18:37:27.000000000 -0800 +++ devel-akpm/drivers/mca/mca-legacy.c 2006-01-31 18:37:27.000000000 -0800 @@ -169,7 +169,7 @@ static int mca_find_device_by_slot_callb 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; diff -L drivers/mca/mca-proc.c -puN drivers/mca/mca-proc.c~remove-drivers-mca-mca-procc /dev/null --- devel/drivers/mca/mca-proc.c +++ /dev/null 2003-09-15 06:40:47.000000000 -0700 @@ -1,249 +0,0 @@ -/* -*- mode: c; c-basic-offset: 8 -*- */ - -/* - * MCA bus support functions for the proc fs. - * - * NOTE: this code *requires* the legacy MCA api. - * - * Legacy API means the API that operates in terms of MCA slot number - * - * (C) 2002 James Bottomley - * -**----------------------------------------------------------------------------- -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation; either version 2 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -** -**----------------------------------------------------------------------------- - */ -#include -#include -#include -#include - -static int get_mca_info_helper(struct mca_device *mca_dev, char *page, int len) -{ - int j; - - for(j=0; j<8; j++) - len += sprintf(page+len, "%02x ", - mca_dev ? mca_dev->pos[j] : 0xff); - len += sprintf(page+len, " %s\n", mca_dev ? mca_dev->name : ""); - return len; -} - -static int get_mca_info(char *page, char **start, off_t off, - int count, int *eof, void *data) -{ - int i, len = 0; - - if(MCA_bus) { - struct mca_device *mca_dev; - /* Format POS registers of eight MCA slots */ - - for(i=0; icount) len = count; - if (len<0) len = 0; - return len; -} - -/*--------------------------------------------------------------------*/ - -static int mca_default_procfn(char* buf, struct mca_device *mca_dev) -{ - int len = 0, i; - int slot = mca_dev->slot; - - /* Print out the basic information */ - - if(slot < MCA_MAX_SLOT_NR) { - len += sprintf(buf+len, "Slot: %d\n", slot+1); - } else if(slot == MCA_INTEGSCSI) { - len += sprintf(buf+len, "Integrated SCSI Adapter\n"); - } else if(slot == MCA_INTEGVIDEO) { - len += sprintf(buf+len, "Integrated Video Adapter\n"); - } else if(slot == MCA_MOTHERBOARD) { - len += sprintf(buf+len, "Motherboard\n"); - } - if (mca_dev->name[0]) { - - /* Drivers might register a name without /proc handler... */ - - len += sprintf(buf+len, "Adapter Name: %s\n", - mca_dev->name); - } else { - len += sprintf(buf+len, "Adapter Name: Unknown\n"); - } - len += sprintf(buf+len, "Id: %02x%02x\n", - mca_dev->pos[1], mca_dev->pos[0]); - len += sprintf(buf+len, "Enabled: %s\nPOS: ", - mca_device_status(mca_dev) == MCA_ADAPTER_NORMAL ? - "Yes" : "No"); - for(i=0; i<8; i++) { - len += sprintf(buf+len, "%02x ", mca_dev->pos[i]); - } - len += sprintf(buf+len, "\nDriver Installed: %s", - mca_device_claimed(mca_dev) ? "Yes" : "No"); - buf[len++] = '\n'; - buf[len] = 0; - - return len; -} /* mca_default_procfn() */ - -static int get_mca_machine_info(char* page, char **start, off_t off, - int count, int *eof, void *data) -{ - int len = 0; - - len += sprintf(page+len, "Model Id: 0x%x\n", machine_id); - len += sprintf(page+len, "Submodel Id: 0x%x\n", machine_submodel_id); - len += sprintf(page+len, "BIOS Revision: 0x%x\n", BIOS_revision); - - if (len <= off+count) *eof = 1; - *start = page + off; - len -= off; - if (len>count) len = count; - if (len<0) len = 0; - return len; -} - -static int mca_read_proc(char *page, char **start, off_t off, - int count, int *eof, void *data) -{ - struct mca_device *mca_dev = (struct mca_device *)data; - int len = 0; - - /* Get the standard info */ - - len = mca_default_procfn(page, mca_dev); - - /* Do any device-specific processing, if there is any */ - - if(mca_dev->procfn) { - len += mca_dev->procfn(page+len, mca_dev->slot, - mca_dev->proc_dev); - } - if (len <= off+count) *eof = 1; - *start = page + off; - len -= off; - if (len>count) len = count; - if (len<0) len = 0; - return len; -} /* mca_read_proc() */ - -/*--------------------------------------------------------------------*/ - -void __init mca_do_proc_init(void) -{ - int i; - struct proc_dir_entry *proc_mca; - struct proc_dir_entry* node = NULL; - struct mca_device *mca_dev; - - proc_mca = proc_mkdir("mca", &proc_root); - create_proc_read_entry("pos",0,proc_mca,get_mca_info,NULL); - create_proc_read_entry("machine",0,proc_mca,get_mca_machine_info,NULL); - - /* Initialize /proc/mca entries for existing adapters */ - - for(i = 0; i < MCA_NUMADAPTERS; i++) { - enum MCA_AdapterStatus status; - mca_dev = mca_find_device_by_slot(i); - if(!mca_dev) - continue; - - mca_dev->procfn = NULL; - - if(i < MCA_MAX_SLOT_NR) sprintf(mca_dev->procname,"slot%d", i+1); - else if(i == MCA_INTEGVIDEO) sprintf(mca_dev->procname,"video"); - else if(i == MCA_INTEGSCSI) sprintf(mca_dev->procname,"scsi"); - else if(i == MCA_MOTHERBOARD) sprintf(mca_dev->procname,"planar"); - - status = mca_device_status(mca_dev); - if (status != MCA_ADAPTER_NORMAL && - status != MCA_ADAPTER_DISABLED) - continue; - - node = create_proc_read_entry(mca_dev->procname, 0, proc_mca, - mca_read_proc, (void *)mca_dev); - - if(node == NULL) { - printk("Failed to allocate memory for MCA proc-entries!"); - return; - } - } - -} /* mca_do_proc_init() */ - -/** - * mca_set_adapter_procfn - Set the /proc callback - * @slot: slot to configure - * @procfn: callback function to call for /proc - * @dev: device information passed to the callback - * - * This sets up an information callback for /proc/mca/slot?. The - * function is called with the buffer, slot, and device pointer (or - * some equally informative context information, or nothing, if you - * prefer), and is expected to put useful information into the - * buffer. The adapter name, ID, and POS registers get printed - * before this is called though, so don't do it again. - * - * This should be called with a %NULL @procfn when a module - * unregisters, thus preventing kernel crashes and other such - * nastiness. - */ - -void mca_set_adapter_procfn(int slot, MCA_ProcFn procfn, void* proc_dev) -{ - struct mca_device *mca_dev = mca_find_device_by_slot(slot); - - if(!mca_dev) - return; - - mca_dev->procfn = procfn; - mca_dev->proc_dev = proc_dev; -} -EXPORT_SYMBOL(mca_set_adapter_procfn); diff -puN drivers/net/3c523.c~remove-drivers-mca-mca-procc drivers/net/3c523.c --- devel/drivers/net/3c523.c~remove-drivers-mca-mca-procc 2006-01-31 18:37:27.000000000 -0800 +++ devel-akpm/drivers/net/3c523.c 2006-01-31 18:37:27.000000000 -0800 @@ -380,37 +380,6 @@ void alloc586(struct net_device *dev) /*****************************************************************/ -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; @@ -460,7 +429,6 @@ static int __init do_elmc_probe(struct n 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); @@ -579,14 +547,12 @@ static int __init do_elmc_probe(struct n 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); } diff -puN drivers/net/eexpress.c~remove-drivers-mca-mca-procc drivers/net/eexpress.c --- devel/drivers/net/eexpress.c~remove-drivers-mca-mca-procc 2006-01-31 18:37:27.000000000 -0800 +++ devel-akpm/drivers/net/eexpress.c 2006-01-31 18:37:27.000000000 -0800 @@ -385,7 +385,6 @@ static int __init do_express_probe(struc } mca_set_adapter_name(slot, "Intel EtherExpress 16 MCA"); - mca_set_adapter_procfn(slot, NULL, dev); mca_mark_as_used(slot); break; diff -puN drivers/net/ibmlana.c~remove-drivers-mca-mca-procc drivers/net/ibmlana.c --- devel/drivers/net/ibmlana.c~remove-drivers-mca-mca-procc 2006-01-31 18:37:27.000000000 -0800 +++ devel-akpm/drivers/net/ibmlana.c 2006-01-31 18:37:27.000000000 -0800 @@ -743,36 +743,6 @@ static irqreturn_t irq_handler(int irq, * 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 @@ static int ibmlana_probe(struct net_devi /* 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 @@ int init_module(void) 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 @@ void cleanup_module(void) 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); } diff -puN drivers/net/ne2.c~remove-drivers-mca-mca-procc drivers/net/ne2.c --- devel/drivers/net/ne2.c~remove-drivers-mca-mca-procc 2006-01-31 18:37:27.000000000 -0800 +++ devel-akpm/drivers/net/ne2.c 2006-01-31 18:37:27.000000000 -0800 @@ -301,29 +301,6 @@ out: } #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, "\n"); - len += sprintf(buf+len, "Modified by "); - len += sprintf(buf+len, "David Weinehall \n"); - len += sprintf(buf+len, "and by Magnus Jonsson \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; @@ -479,8 +456,6 @@ static int __init ne2_probe1(struct net_ 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; @@ -511,7 +486,6 @@ static int __init ne2_probe1(struct net_ 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); @@ -808,7 +782,6 @@ int init_module(void) 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); } diff -puN drivers/net/sk_mca.c~remove-drivers-mca-mca-procc drivers/net/sk_mca.c --- devel/drivers/net/sk_mca.c~remove-drivers-mca-mca-procc 2006-01-31 18:37:27.000000000 -0800 +++ devel-akpm/drivers/net/sk_mca.c 2006-01-31 18:37:27.000000000 -0800 @@ -1016,7 +1016,6 @@ static void cleanup_card(struct net_devi 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 @@ struct net_device * __init skmca_probe(i "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 @@ struct net_device * __init skmca_probe(i 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); diff -puN drivers/net/tokenring/madgemc.c~remove-drivers-mca-mca-procc drivers/net/tokenring/madgemc.c --- devel/drivers/net/tokenring/madgemc.c~remove-drivers-mca-mca-procc 2006-01-31 18:37:27.000000000 -0800 +++ devel-akpm/drivers/net/tokenring/madgemc.c 2006-01-31 18:37:27.000000000 -0800 @@ -64,8 +64,6 @@ static void madgemc_read_rom(struct net_ static unsigned short madgemc_setnselout_pins(struct net_device *dev); static void madgemc_setcabletype(struct net_device *dev, int type); -static int madgemc_mcaproc(char *buf, int slot, void *d); - static void madgemc_setregpage(struct net_device *dev, int page); static void madgemc_setsifsel(struct net_device *dev, int val); static void madgemc_setint(struct net_device *dev, int val); @@ -322,7 +320,6 @@ static int __devinit madgemc_probe(struc /* Setup MCA structures */ mca_device_set_name(mdev, (card->cardtype == 0x08)?MADGEMC16_CARDNAME:MADGEMC32_CARDNAME); - mca_set_adapter_procfn(mdev->slot, madgemc_mcaproc, dev); printk("%s: Ring Station Address: ", dev->name); printk("%2.2x", dev->dev_addr[0]); @@ -685,50 +682,6 @@ static int madgemc_close(struct net_devi return 0; } -/* - * Give some details available from /proc/mca/slotX - */ -static int madgemc_mcaproc(char *buf, int slot, void *d) -{ - struct net_device *dev = (struct net_device *)d; - struct net_local *tp = dev->priv; - struct card_info *curcard = tp->tmspriv; - int len = 0; - - len += sprintf(buf+len, "-------\n"); - if (curcard) { - struct net_local *tp = netdev_priv(dev); - int i; - - len += sprintf(buf+len, "Card Revision: %d\n", curcard->cardrev); - len += sprintf(buf+len, "RAM Size: %dkb\n", curcard->ramsize); - len += sprintf(buf+len, "Cable type: %s\n", (curcard->cabletype)?"STP/DB9":"UTP/RJ-45"); - len += sprintf(buf+len, "Configured ring speed: %dMb/sec\n", (curcard->ringspeed)?16:4); - len += sprintf(buf+len, "Running ring speed: %dMb/sec\n", (tp->DataRate==SPEED_16)?16:4); - len += sprintf(buf+len, "Device: %s\n", dev->name); - len += sprintf(buf+len, "IO Port: 0x%04lx\n", dev->base_addr); - len += sprintf(buf+len, "IRQ: %d\n", dev->irq); - len += sprintf(buf+len, "Arbitration Level: %d\n", curcard->arblevel); - len += sprintf(buf+len, "Burst Mode: "); - switch(curcard->burstmode) { - case 0: len += sprintf(buf+len, "Cycle steal"); break; - case 1: len += sprintf(buf+len, "Limited burst"); break; - case 2: len += sprintf(buf+len, "Delayed release"); break; - case 3: len += sprintf(buf+len, "Immediate release"); break; - } - len += sprintf(buf+len, " (%s)\n", (curcard->fairness)?"Unfair":"Fair"); - - len += sprintf(buf+len, "Ring Station Address: "); - len += sprintf(buf+len, "%2.2x", dev->dev_addr[0]); - for (i = 1; i < 6; i++) - len += sprintf(buf+len, " %2.2x", dev->dev_addr[i]); - len += sprintf(buf+len, "\n"); - } else - len += sprintf(buf+len, "Card not configured\n"); - - return len; -} - static int __devexit madgemc_remove(struct device *device) { struct net_device *dev = dev_get_drvdata(device); diff -puN drivers/scsi/aha1542.c~remove-drivers-mca-mca-procc drivers/scsi/aha1542.c --- devel/drivers/scsi/aha1542.c~remove-drivers-mca-mca-procc 2006-01-31 18:37:27.000000000 -0800 +++ devel-akpm/drivers/scsi/aha1542.c 2006-01-31 18:37:27.000000000 -0800 @@ -1116,7 +1116,6 @@ static int __init aha1542_detect(struct 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 */ diff -puN drivers/scsi/ibmmca.c~remove-drivers-mca-mca-procc drivers/scsi/ibmmca.c --- devel/drivers/scsi/ibmmca.c~remove-drivers-mca-mca-procc 2006-01-31 18:37:27.000000000 -0800 +++ devel-akpm/drivers/scsi/ibmmca.c 2006-01-31 18:37:27.000000000 -0800 @@ -1432,57 +1432,6 @@ static void internal_ibmmca_scsi_setup(c return; } -static int ibmmca_getinfo(char *buf, int slot, void *dev_id) -{ - struct Scsi_Host *shpnt; - int len, speciale, connectore, k; - unsigned int pos[8]; - unsigned long flags; - struct Scsi_Host *dev = dev_id; - - spin_lock_irqsave(dev->host_lock, flags); - - shpnt = dev; /* assign host-structure to local pointer */ - len = 0; /* set filled text-buffer index to 0 */ - /* get the _special contents of the hostdata structure */ - speciale = ((struct ibmmca_hostdata *) shpnt->hostdata)->_special; - connectore = ((struct ibmmca_hostdata *) shpnt->hostdata)->_connector_size; - for (k = 2; k < 4; k++) - pos[k] = ((struct ibmmca_hostdata *) shpnt->hostdata)->_pos[k]; - if (speciale == FORCED_DETECTION) { /* forced detection */ - len += sprintf(buf + len, - "Adapter category: forced detected\n" "***************************************\n" "*** Forced detected SCSI Adapter ***\n" "*** No chip-information available ***\n" "***************************************\n"); - } else if (speciale == INTEGRATED_SCSI) { - /* if the integrated subsystem has been found automatically: */ - len += sprintf(buf + len, - "Adapter category: integrated\n" "Chip revision level: %d\n" "Chip status: %s\n" "8 kByte NVRAM status: %s\n", ((pos[2] & 0xf0) >> 4), (pos[2] & 1) ? "enabled" : "disabled", (pos[2] & 2) ? "locked" : "accessible"); - } else if ((speciale >= 0) && (speciale < (sizeof(subsys_list) / sizeof(struct subsys_list_struct)))) { - /* if the subsystem is a slot adapter */ - len += sprintf(buf + len, "Adapter category: slot-card\n" "ROM Segment Address: "); - if ((pos[2] & 0xf0) == 0xf0) - len += sprintf(buf + len, "off\n"); - else - len += sprintf(buf + len, "0x%x\n", ((pos[2] & 0xf0) << 13) + 0xc0000); - len += sprintf(buf + len, "Chip status: %s\n", (pos[2] & 1) ? "enabled" : "disabled"); - len += sprintf(buf + len, "Adapter I/O Offset: 0x%x\n", ((pos[2] & 0x0e) << 2)); - } else { - len += sprintf(buf + len, "Adapter category: unknown\n"); - } - /* common subsystem information to write to the slotn file */ - len += sprintf(buf + len, "Subsystem PUN: %d\n", shpnt->this_id); - len += sprintf(buf + len, "I/O base address range: 0x%x-0x%x\n", (unsigned int) (shpnt->io_port), (unsigned int) (shpnt->io_port + 7)); - len += sprintf(buf + len, "MCA-slot size: %d bits", connectore); - /* Now make sure, the bufferlength is devidable by 4 to avoid - * paging problems of the buffer. */ - while (len % sizeof(int) != (sizeof(int) - 1)) - len += sprintf(buf + len, " "); - len += sprintf(buf + len, "\n"); - - spin_unlock_irqrestore(shpnt->host_lock, flags); - - return len; -} - int ibmmca_detect(struct scsi_host_template * scsi_template) { struct Scsi_Host *shpnt; @@ -1526,7 +1475,6 @@ int ibmmca_detect(struct scsi_host_templ ((struct ibmmca_hostdata *) shpnt->hostdata)->_pos[k] = 0; ((struct ibmmca_hostdata *) shpnt->hostdata)->_special = FORCED_DETECTION; mca_set_adapter_name(MCA_INTEGSCSI, "forced detected SCSI Adapter"); - mca_set_adapter_procfn(MCA_INTEGSCSI, (MCA_ProcFn) ibmmca_getinfo, shpnt); mca_mark_as_used(MCA_INTEGSCSI); devices_on_irq_14++; } @@ -1594,7 +1542,6 @@ int ibmmca_detect(struct scsi_host_templ ((struct ibmmca_hostdata *) shpnt->hostdata)->_pos[k] = pos[k]; ((struct ibmmca_hostdata *) shpnt->hostdata)->_special = INTEGRATED_SCSI; mca_set_adapter_name(MCA_INTEGSCSI, "IBM Integrated SCSI Controller"); - mca_set_adapter_procfn(MCA_INTEGSCSI, (MCA_ProcFn) ibmmca_getinfo, shpnt); mca_mark_as_used(MCA_INTEGSCSI); devices_on_irq_14++; } @@ -1655,7 +1602,6 @@ int ibmmca_detect(struct scsi_host_templ ((struct ibmmca_hostdata *) shpnt->hostdata)->_pos[k] = pos[k]; ((struct ibmmca_hostdata *) shpnt->hostdata)->_special = i; mca_set_adapter_name(slot, subsys_list[i].description); - mca_set_adapter_procfn(slot, (MCA_ProcFn) ibmmca_getinfo, shpnt); mca_mark_as_used(slot); if ((i == IBM_SCSI2_FW) && (pos[4] & 0x01) && (pos[6] == 0)) devices_on_irq_11++; @@ -1717,7 +1663,6 @@ int ibmmca_detect(struct scsi_host_templ ((struct ibmmca_hostdata *) shpnt->hostdata)->_pos[k] = pos[k]; ((struct ibmmca_hostdata *) shpnt->hostdata)->_special = i; mca_set_adapter_name(slot, subsys_list[i].description); - mca_set_adapter_procfn(slot, (MCA_ProcFn) ibmmca_getinfo, shpnt); mca_mark_as_used(slot); if ((i == IBM_SCSI2_FW) && (pos[4] & 0x01) && (pos[6] == 0)) devices_on_irq_11++; diff -puN include/asm-i386/bugs.h~remove-drivers-mca-mca-procc include/asm-i386/bugs.h --- devel/include/asm-i386/bugs.h~remove-drivers-mca-mca-procc 2006-01-31 18:37:27.000000000 -0800 +++ devel-akpm/include/asm-i386/bugs.h 2006-01-31 18:37:27.000000000 -0800 @@ -31,14 +31,6 @@ static int __init no_halt(char *s) __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; diff -puN include/asm-i386/processor.h~remove-drivers-mca-mca-procc include/asm-i386/processor.h --- devel/include/asm-i386/processor.h~remove-drivers-mca-mca-procc 2006-01-31 18:37:27.000000000 -0800 +++ devel-akpm/include/asm-i386/processor.h 2006-01-31 18:37:27.000000000 -0800 @@ -305,13 +305,6 @@ static inline void __mwait(unsigned long : :"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; diff -puN include/linux/mca.h~remove-drivers-mca-mca-procc include/linux/mca.h --- devel/include/linux/mca.h~remove-drivers-mca-mca-procc 2006-01-31 18:37:27.000000000 -0800 +++ devel-akpm/include/linux/mca.h 2006-01-31 18:37:27.000000000 -0800 @@ -58,14 +58,6 @@ struct mca_device { 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 @@ struct mca_driver { #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 @@ static inline char *mca_device_get_name( 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 @@ extern void mca_unregister_driver(struct /* 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 */ _