X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fpcmcia%2Fcardbus.c;h=2d7effe7990d9c67136a44617e31bed2290a7026;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=96700495c27f65e1d1cdc78dcaba8f1beb25548f;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c index 96700495c..2d7effe79 100644 --- a/drivers/pcmcia/cardbus.c +++ b/drivers/pcmcia/cardbus.c @@ -1,35 +1,16 @@ -/*====================================================================== - - Cardbus device configuration - - cardbus.c 1.87 2002/10/24 06:11: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. - -======================================================================*/ +/* + * cardbus.c -- 16-bit PCMCIA core support + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + * + * (C) 1999 David A. Hinds + */ /* * Cardbus handling has been re-written to be more of a PCI bridge thing, @@ -50,7 +31,6 @@ #include #define IN_CARD_SERVICES -#include #include #include #include @@ -85,7 +65,7 @@ =====================================================================*/ -static u_int xlate_rom_addr(u_char * b, u_int addr) +static u_int xlate_rom_addr(void __iomem *b, u_int addr) { u_int img = 0, ofs = 0, sz; u_short data; @@ -118,7 +98,7 @@ static void cb_release_cis_mem(struct pcmcia_socket * s) cs_dbg(s, 1, "cb_release_cis_mem()\n"); iounmap(s->cb_cis_virt); s->cb_cis_virt = NULL; - s->cb_cis_res = 0; + s->cb_cis_res = NULL; } } @@ -158,7 +138,7 @@ int read_cb_mem(struct pcmcia_socket * s, int space, u_int addr, u_int len, void cs_dbg(s, 3, "read_cb_mem(%d, %#x, %u)\n", space, addr, len); - dev = pci_find_slot(s->cb_dev->subordinate->number, 0); + dev = pci_get_slot(s->cb_dev->subordinate, 0); if (!dev) goto fail; @@ -172,6 +152,9 @@ int read_cb_mem(struct pcmcia_socket * s, int space, u_int addr, u_int len, void } res = dev->resource + space - 1; + + pci_dev_put(dev); + if (!res->flags) goto fail; @@ -248,6 +231,11 @@ int cb_alloc(struct pcmcia_socket * s) pci_bus_size_bridges(bus); pci_bus_assign_resources(bus); cardbus_assign_irqs(bus, s->pci_irq); + + /* socket specific tune function */ + if (s->tune_bridge) + s->tune_bridge(s, bus); + pci_enable_bridges(bus); pci_bus_add_devices(bus);