Patch from Russell King pcmcia-3.diff Remove the bus_* abstractions; they are unused. 25-akpm/drivers/pcmcia/cistpl.c | 56 +++++------ 25-akpm/drivers/pcmcia/cs.c | 6 - 25-akpm/drivers/pcmcia/sa1100_generic.c | 1 25-akpm/drivers/pcmcia/yenta.c | 1 25-akpm/include/pcmcia/bus_ops.h | 154 -------------------------------- 25-akpm/include/pcmcia/cs.h | 1 25-akpm/include/pcmcia/ss.h | 1 7 files changed, 31 insertions(+), 189 deletions(-) diff -puN drivers/pcmcia/cistpl.c~pcmcia-2-remove-bus_foo-abstractions drivers/pcmcia/cistpl.c --- 25/drivers/pcmcia/cistpl.c~pcmcia-2-remove-bus_foo-abstractions Wed Mar 12 13:34:43 2003 +++ 25-akpm/drivers/pcmcia/cistpl.c Wed Mar 12 13:34:43 2003 @@ -49,7 +49,6 @@ #include #include -#include #include #include #include @@ -103,9 +102,8 @@ static void set_cis_map(socket_info_t *s s->ss_entry->set_mem_map(s->sock, mem); if (s->cap.features & SS_CAP_STATIC_MAP) { if (s->cis_virt) - bus_iounmap(s->cap.bus, s->cis_virt); - s->cis_virt = bus_ioremap(s->cap.bus, mem->sys_start, - s->cap.map_size); + iounmap(s->cis_virt); + s->cis_virt = ioremap(mem->sys_start, s->cap.map_size); } } @@ -130,13 +128,13 @@ int read_cis_mem(socket_info_t *s, int a mem->card_start = 0; mem->flags = MAP_ACTIVE; set_cis_map(s, mem); sys = s->cis_virt; - bus_writeb(s->cap.bus, flags, sys+CISREG_ICTRL0); - bus_writeb(s->cap.bus, addr & 0xff, sys+CISREG_IADDR0); - bus_writeb(s->cap.bus, (addr>>8) & 0xff, sys+CISREG_IADDR1); - bus_writeb(s->cap.bus, (addr>>16) & 0xff, sys+CISREG_IADDR2); - bus_writeb(s->cap.bus, (addr>>24) & 0xff, sys+CISREG_IADDR3); + writeb(flags, sys+CISREG_ICTRL0); + writeb(addr & 0xff, sys+CISREG_IADDR0); + writeb((addr>>8) & 0xff, sys+CISREG_IADDR1); + writeb((addr>>16) & 0xff, sys+CISREG_IADDR2); + writeb((addr>>24) & 0xff, sys+CISREG_IADDR3); for ( ; len > 0; len--, buf++) - *buf = bus_readb(s->cap.bus, sys+CISREG_IDATA0); + *buf = readb(sys+CISREG_IDATA0); } else { u_int inc = 1; if (attr) { mem->flags |= MAP_ATTRIB; inc++; addr *= 2; } @@ -147,7 +145,7 @@ int read_cis_mem(socket_info_t *s, int a sys = s->cis_virt + (addr & (s->cap.map_size-1)); for ( ; len > 0; len--, buf++, sys += inc) { if (sys == s->cis_virt+s->cap.map_size) break; - *buf = bus_readb(s->cap.bus, sys); + *buf = readb(sys); } mem->card_start += s->cap.map_size; addr = 0; @@ -177,13 +175,13 @@ void write_cis_mem(socket_info_t *s, int mem->card_start = 0; mem->flags = MAP_ACTIVE; set_cis_map(s, mem); sys = s->cis_virt; - bus_writeb(s->cap.bus, flags, sys+CISREG_ICTRL0); - bus_writeb(s->cap.bus, addr & 0xff, sys+CISREG_IADDR0); - bus_writeb(s->cap.bus, (addr>>8) & 0xff, sys+CISREG_IADDR1); - bus_writeb(s->cap.bus, (addr>>16) & 0xff, sys+CISREG_IADDR2); - bus_writeb(s->cap.bus, (addr>>24) & 0xff, sys+CISREG_IADDR3); + writeb(flags, sys+CISREG_ICTRL0); + writeb(addr & 0xff, sys+CISREG_IADDR0); + writeb((addr>>8) & 0xff, sys+CISREG_IADDR1); + writeb((addr>>16) & 0xff, sys+CISREG_IADDR2); + writeb((addr>>24) & 0xff, sys+CISREG_IADDR3); for ( ; len > 0; len--, buf++) - bus_writeb(s->cap.bus, *buf, sys+CISREG_IDATA0); + writeb(*buf, sys+CISREG_IDATA0); } else { int inc = 1; if (attr & IS_ATTR) { mem->flags |= MAP_ATTRIB; inc++; addr *= 2; } @@ -193,7 +191,7 @@ void write_cis_mem(socket_info_t *s, int sys = s->cis_virt + (addr & (s->cap.map_size-1)); for ( ; len > 0; len--, buf++, sys += inc) { if (sys == s->cis_virt+s->cap.map_size) break; - bus_writeb(s->cap.bus, *buf, sys); + writeb(*buf, sys); } mem->card_start += s->cap.map_size; addr = 0; @@ -218,18 +216,19 @@ static int cis_readable(u_long base) int ret; vs->cis_mem.sys_start = base; vs->cis_mem.sys_stop = base+vs->cap.map_size-1; - vs->cis_virt = bus_ioremap(vs->cap.bus, base, vs->cap.map_size); + vs->cis_virt = ioremap(base, vs->cap.map_size); ret = pcmcia_validate_cis(vs->clients, &info1); /* invalidate mapping and CIS cache */ - bus_iounmap(vs->cap.bus, vs->cis_virt); vs->cis_used = 0; + iounmap(vs->cis_virt); + vs->cis_used = 0; if ((ret != 0) || (info1.Chains == 0)) return 0; vs->cis_mem.sys_start = base+vs->cap.map_size; vs->cis_mem.sys_stop = base+2*vs->cap.map_size-1; - vs->cis_virt = bus_ioremap(vs->cap.bus, base+vs->cap.map_size, - vs->cap.map_size); + vs->cis_virt = ioremap(base+vs->cap.map_size, vs->cap.map_size); ret = pcmcia_validate_cis(vs->clients, &info2); - bus_iounmap(vs->cap.bus, vs->cis_virt); vs->cis_used = 0; + iounmap(vs->cis_virt); + vs->cis_used = 0; return ((ret == 0) && (info1.Chains == info2.Chains)); } @@ -239,17 +238,17 @@ static int checksum(u_long base) int i, a, b, d; vs->cis_mem.sys_start = base; vs->cis_mem.sys_stop = base+vs->cap.map_size-1; - vs->cis_virt = bus_ioremap(vs->cap.bus, base, vs->cap.map_size); + vs->cis_virt = ioremap(base, vs->cap.map_size); vs->cis_mem.card_start = 0; vs->cis_mem.flags = MAP_ACTIVE; vs->ss_entry->set_mem_map(vs->sock, &vs->cis_mem); /* Don't bother checking every word... */ a = 0; b = -1; for (i = 0; i < vs->cap.map_size; i += 44) { - d = bus_readl(vs->cap.bus, vs->cis_virt+i); + d = readl(vs->cis_virt+i); a += d; b &= d; } - bus_iounmap(vs->cap.bus, vs->cis_virt); + iounmap(vs->cis_virt); return (b == -1) ? -1 : (a>>1); } @@ -274,8 +273,7 @@ static int setup_cis_mem(socket_info_t * return -1; } s->cis_mem.sys_stop = s->cis_mem.sys_start+s->cap.map_size-1; - s->cis_virt = bus_ioremap(s->cap.bus, s->cis_mem.sys_start, - s->cap.map_size); + s->cis_virt = ioremap(s->cis_mem.sys_start, s->cap.map_size); } return 0; } @@ -287,7 +285,7 @@ void release_cis_mem(socket_info_t *s) s->ss_entry->set_mem_map(s->sock, &s->cis_mem); if (!(s->cap.features & SS_CAP_STATIC_MAP)) release_mem_region(s->cis_mem.sys_start, s->cap.map_size); - bus_iounmap(s->cap.bus, s->cis_virt); + iounmap(s->cis_virt); s->cis_mem.sys_start = 0; s->cis_virt = NULL; } diff -puN drivers/pcmcia/cs.c~pcmcia-2-remove-bus_foo-abstractions drivers/pcmcia/cs.c --- 25/drivers/pcmcia/cs.c~pcmcia-2-remove-bus_foo-abstractions Wed Mar 12 13:34:43 2003 +++ 25-akpm/drivers/pcmcia/cs.c Wed Mar 12 13:34:43 2003 @@ -59,7 +59,6 @@ #include #include #include -#include #include "cs_internal.h" #ifdef CONFIG_PCI @@ -1469,7 +1468,6 @@ int pcmcia_register_client(client_handle client->event_handler = req->event_handler; client->event_callback_args = req->event_callback_args; client->event_callback_args.client_handle = client; - client->event_callback_args.bus = s->cap.bus; if (s->state & SOCKET_CARDBUS) client->state |= CLIENT_CARDBUS; @@ -1618,7 +1616,7 @@ int pcmcia_release_irq(client_handle_t h } if (req->Attributes & IRQ_HANDLE_PRESENT) { - bus_free_irq(s->cap.bus, req->AssignedIRQ, req->Instance); + free_irq(req->AssignedIRQ, req->Instance); } #ifdef CONFIG_ISA @@ -1913,7 +1911,7 @@ int pcmcia_request_irq(client_handle_t h if (ret != 0) return ret; if (req->Attributes & IRQ_HANDLE_PRESENT) { - if (bus_request_irq(s->cap.bus, irq, req->Handler, + if (request_irq(irq, req->Handler, ((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) || (s->functions > 1) || (irq == s->cap.pci_irq)) ? SA_SHIRQ : 0, diff -puN drivers/pcmcia/sa1100_generic.c~pcmcia-2-remove-bus_foo-abstractions drivers/pcmcia/sa1100_generic.c --- 25/drivers/pcmcia/sa1100_generic.c~pcmcia-2-remove-bus_foo-abstractions Wed Mar 12 13:34:43 2003 +++ 25-akpm/drivers/pcmcia/sa1100_generic.c Wed Mar 12 13:34:43 2003 @@ -52,7 +52,6 @@ #include #include #include -#include #include #include diff -puN drivers/pcmcia/yenta.c~pcmcia-2-remove-bus_foo-abstractions drivers/pcmcia/yenta.c --- 25/drivers/pcmcia/yenta.c~pcmcia-2-remove-bus_foo-abstractions Wed Mar 12 13:34:43 2003 +++ 25-akpm/drivers/pcmcia/yenta.c Wed Mar 12 13:34:43 2003 @@ -514,7 +514,6 @@ static void yenta_get_socket_capabilitie socket->cap.pci_irq = socket->cb_irq; socket->cap.irq_mask = yenta_probe_irq(socket, isa_irq_mask); socket->cap.cb_dev = socket->dev; - socket->cap.bus = NULL; printk("Yenta IRQ list %04x, PCI irq%d\n", socket->cap.irq_mask, socket->cb_irq); } diff -puN include/pcmcia/bus_ops.h~pcmcia-2-remove-bus_foo-abstractions include/pcmcia/bus_ops.h --- 25/include/pcmcia/bus_ops.h~pcmcia-2-remove-bus_foo-abstractions Wed Mar 12 13:34:43 2003 +++ 25-akpm/include/pcmcia/bus_ops.h Wed Mar 12 13:34:43 2003 @@ -1,152 +1,2 @@ -/* - * bus_ops.h 1.10 2000/06/12 21:55:41 - * - * The contents of this file are subject to the Mozilla Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License - * at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - * the License for the specific language governing rights and - * limitations under the License. - * - * The initial developer of the original code is David A. Hinds - * . Portions created by David A. Hinds - * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision by - * deleting the provisions above and replace them with the notice and - * other provisions required by the GPL. If you do not delete the - * provisions above, a recipient may use your version of this file - * under either the MPL or the GPL. - */ - -#ifndef _LINUX_BUS_OPS_H -#define _LINUX_BUS_OPS_H - -#include - -#ifdef CONFIG_VIRTUAL_BUS - -typedef struct bus_operations { - void *priv; - u32 (*b_in)(void *bus, u32 port, s32 sz); - void (*b_ins)(void *bus, u32 port, void *buf, - u32 count, s32 sz); - void (*b_out)(void *bus, u32 val, u32 port, s32 sz); - void (*b_outs)(void *bus, u32 port, void *buf, - u32 count, s32 sz); - void *(*b_ioremap)(void *bus, u_long ofs, u_long sz); - void (*b_iounmap)(void *bus, void *addr); - u32 (*b_read)(void *bus, void *addr, s32 sz); - void (*b_write)(void *bus, u32 val, void *addr, s32 sz); - void (*b_copy_from)(void *bus, void *d, void *s, u32 count); - void (*b_copy_to)(void *bus, void *d, void *s, u32 count); - int (*b_request_irq)(void *bus, u_int irq, - void (*handler)(int, void *, - struct pt_regs *), - u_long flags, const char *device, - void *dev_id); - void (*b_free_irq)(void *bus, u_int irq, void *dev_id); -} bus_operations; - -#define bus_inb(b,p) (b)->b_in((b),(p),0) -#define bus_inw(b,p) (b)->b_in((b),(p),1) -#define bus_inl(b,p) (b)->b_in((b),(p),2) -#define bus_inw_ns(b,p) (b)->b_in((b),(p),-1) -#define bus_inl_ns(b,p) (b)->b_in((b),(p),-2) - -#define bus_insb(b,p,a,c) (b)->b_ins((b),(p),(a),(c),0) -#define bus_insw(b,p,a,c) (b)->b_ins((b),(p),(a),(c),1) -#define bus_insl(b,p,a,c) (b)->b_ins((b),(p),(a),(c),2) -#define bus_insw_ns(b,p,a,c) (b)->b_ins((b),(p),(a),(c),-1) -#define bus_insl_ns(b,p,a,c) (b)->b_ins((b),(p),(a),(c),-2) - -#define bus_outb(b,v,p) (b)->b_out((b),(v),(p),0) -#define bus_outw(b,v,p) (b)->b_out((b),(v),(p),1) -#define bus_outl(b,v,p) (b)->b_out((b),(v),(p),2) -#define bus_outw_ns(b,v,p) (b)->b_out((b),(v),(p),-1) -#define bus_outl_ns(b,v,p) (b)->b_out((b),(v),(p),-2) - -#define bus_outsb(b,p,a,c) (b)->b_outs((b),(p),(a),(c),0) -#define bus_outsw(b,p,a,c) (b)->b_outs((b),(p),(a),(c),1) -#define bus_outsl(b,p,a,c) (b)->b_outs((b),(p),(a),(c),2) -#define bus_outsw_ns(b,p,a,c) (b)->b_outs((b),(p),(a),(c),-1) -#define bus_outsl_ns(b,p,a,c) (b)->b_outs((b),(p),(a),(c),-2) - -#define bus_readb(b,a) (b)->b_read((b),(a),0) -#define bus_readw(b,a) (b)->b_read((b),(a),1) -#define bus_readl(b,a) (b)->b_read((b),(a),2) -#define bus_readw_ns(b,a) (b)->b_read((b),(a),-1) -#define bus_readl_ns(b,a) (b)->b_read((b),(a),-2) - -#define bus_writeb(b,v,a) (b)->b_write((b),(v),(a),0) -#define bus_writew(b,v,a) (b)->b_write((b),(v),(a),1) -#define bus_writel(b,v,a) (b)->b_write((b),(v),(a),2) -#define bus_writew_ns(b,v,a) (b)->b_write((b),(v),(a),-1) -#define bus_writel_ns(b,v,a) (b)->b_write((b),(v),(a),-2) - -#define bus_ioremap(b,s,n) (b)->b_ioremap((b),(s),(n)) -#define bus_iounmap(b,a) (b)->b_iounmap((b),(a)) -#define bus_memcpy_fromio(b,d,s,n) (b)->b_copy_from((b),(d),(s),(n)) -#define bus_memcpy_toio(b,d,s,n) (b)->b_copy_to((b),(d),(s),(n)) - -#define bus_request_irq(b,i,h,f,n,d) \ - (b)->b_request_irq((b),(i),(h),(f),(n),(d)) -#define bus_free_irq(b,i,d) (b)->b_free_irq((b),(i),(d)) - -#else - -#define bus_inb(b,p) inb(p) -#define bus_inw(b,p) inw(p) -#define bus_inl(b,p) inl(p) -#define bus_inw_ns(b,p) inw_ns(p) -#define bus_inl_ns(b,p) inl_ns(p) - -#define bus_insb(b,p,a,c) insb(p,a,c) -#define bus_insw(b,p,a,c) insw(p,a,c) -#define bus_insl(b,p,a,c) insl(p,a,c) -#define bus_insw_ns(b,p,a,c) insw_ns(p,a,c) -#define bus_insl_ns(b,p,a,c) insl_ns(p,a,c) - -#define bus_outb(b,v,p) outb(b,v,p) -#define bus_outw(b,v,p) outw(b,v,p) -#define bus_outl(b,v,p) outl(b,v,p) -#define bus_outw_ns(b,v,p) outw_ns(b,v,p) -#define bus_outl_ns(b,v,p) outl_ns(b,v,p) - -#define bus_outsb(b,p,a,c) outsb(p,a,c) -#define bus_outsw(b,p,a,c) outsw(p,a,c) -#define bus_outsl(b,p,a,c) outsl(p,a,c) -#define bus_outsw_ns(b,p,a,c) outsw_ns(p,a,c) -#define bus_outsl_ns(b,p,a,c) outsl_ns(p,a,c) - -#define bus_readb(b,a) readb(a) -#define bus_readw(b,a) readw(a) -#define bus_readl(b,a) readl(a) -#define bus_readw_ns(b,a) readw_ns(a) -#define bus_readl_ns(b,a) readl_ns(a) - -#define bus_writeb(b,v,a) writeb(v,a) -#define bus_writew(b,v,a) writew(v,a) -#define bus_writel(b,v,a) writel(v,a) -#define bus_writew_ns(b,v,a) writew_ns(v,a) -#define bus_writel_ns(b,v,a) writel_ns(v,a) - -#define bus_ioremap(b,s,n) ioremap(s,n) -#define bus_iounmap(b,a) iounmap(a) -#define bus_memcpy_fromio(b,d,s,n) memcpy_fromio(d,s,n) -#define bus_memcpy_toio(b,d,s,n) memcpy_toio(d,s,n) - -#define bus_request_irq(b,i,h,f,n,d) request_irq((i),(h),(f),(n),(d)) -#define bus_free_irq(b,i,d) free_irq((i),(d)) - -#endif /* CONFIG_VIRTUAL_BUS */ - -#endif /* _LINUX_BUS_OPS_H */ +/* now empty */ +#warning please remove the reference to this file diff -puN include/pcmcia/cs.h~pcmcia-2-remove-bus_foo-abstractions include/pcmcia/cs.h --- 25/include/pcmcia/cs.h~pcmcia-2-remove-bus_foo-abstractions Wed Mar 12 13:34:43 2003 +++ 25-akpm/include/pcmcia/cs.h Wed Mar 12 13:34:43 2003 @@ -98,7 +98,6 @@ typedef struct event_callback_args_t { void *buffer; void *misc; void *client_data; - struct bus_operations *bus; } event_callback_args_t; /* for GetConfigurationInfo */ diff -puN include/pcmcia/ss.h~pcmcia-2-remove-bus_foo-abstractions include/pcmcia/ss.h --- 25/include/pcmcia/ss.h~pcmcia-2-remove-bus_foo-abstractions Wed Mar 12 13:34:43 2003 +++ 25-akpm/include/pcmcia/ss.h Wed Mar 12 13:34:43 2003 @@ -58,7 +58,6 @@ typedef struct socket_cap_t { ioaddr_t io_offset; u_char pci_irq; struct pci_dev *cb_dev; - struct bus_operations *bus; } socket_cap_t; /* InquireSocket capabilities */ _