Make rsrc_nonstatic an independent module. Signed-off-by: Dominik Brodowski drivers/pcmcia/Kconfig | 9 +++++++++ drivers/pcmcia/Makefile | 4 +++- drivers/pcmcia/cistpl.c | 2 ++ drivers/pcmcia/cs.c | 8 ++------ drivers/pcmcia/cs_internal.h | 2 -- drivers/pcmcia/hd64465_ss.c | 1 + drivers/pcmcia/i82092.c | 1 + drivers/pcmcia/i82365.c | 1 + drivers/pcmcia/m32r_cfc.c | 1 + drivers/pcmcia/m32r_pcc.c | 1 + drivers/pcmcia/pd6729.c | 1 + drivers/pcmcia/rsrc_mgr.c | 1 + drivers/pcmcia/rsrc_nonstatic.c | 4 ++++ drivers/pcmcia/soc_common.c | 1 + drivers/pcmcia/tcic.c | 3 ++- drivers/pcmcia/yenta_socket.c | 1 + include/pcmcia/ss.h | 4 ++++ 17 files changed, 35 insertions(+), 10 deletions(-) diff -ruN linux-original/drivers/pcmcia/cistpl.c linux/drivers/pcmcia/cistpl.c --- linux-original/drivers/pcmcia/cistpl.c 2004-11-14 09:01:32.000000000 +0100 +++ linux/drivers/pcmcia/cistpl.c 2004-11-14 10:38:41.599926192 +0100 @@ -78,6 +78,7 @@ s->cis_virt = NULL; } } +EXPORT_SYMBOL(release_cis_mem); /* * Map the card memory at "card_offset" into virtual space. @@ -320,6 +321,7 @@ s->fake_cis = NULL; } } +EXPORT_SYMBOL(destroy_cis_cache); /*====================================================================== diff -ruN linux-original/drivers/pcmcia/cs.c linux/drivers/pcmcia/cs.c --- linux-original/drivers/pcmcia/cs.c 2004-11-14 10:35:51.000000000 +0100 +++ linux/drivers/pcmcia/cs.c 2004-11-14 10:38:41.601925888 +0100 @@ -212,7 +212,7 @@ { int ret; - if (!socket || !socket->ops || !socket->dev.dev) + if (!socket || !socket->ops || !socket->dev.dev || !socket->resource_ops) return -EINVAL; cs_dbg(socket, 0, "pcmcia_register_socket(0x%p)\n", socket->ops); @@ -250,11 +250,7 @@ socket->cis_mem.flags = 0; socket->cis_mem.speed = cis_speed; - /* init resource handling */ - if (socket->features & SS_CAP_STATIC_MAP) - socket->resource_ops = &pccard_static_ops; - else - socket->resource_ops = &pccard_nonstatic_ops; + socket->mem_db.next = &socket->mem_db; socket->io_db.next = &socket->io_db; diff -ruN linux-original/drivers/pcmcia/cs_internal.h linux/drivers/pcmcia/cs_internal.h --- linux-original/drivers/pcmcia/cs_internal.h 2004-11-14 10:35:51.000000000 +0100 +++ linux/drivers/pcmcia/cs_internal.h 2004-11-14 10:38:41.602925736 +0100 @@ -144,8 +144,6 @@ void undo_irq(u_int Attributes, int irq); int adjust_resource_info(client_handle_t handle, adjust_t *adj); void release_resource_db(struct pcmcia_socket *s); -extern struct pccard_resource_ops pccard_static_ops; -extern struct pccard_resource_ops pccard_nonstatic_ops; /* In socket_sysfs.c */ extern struct class_interface pccard_sysfs_interface; diff -ruN linux-original/drivers/pcmcia/hd64465_ss.c linux/drivers/pcmcia/hd64465_ss.c --- linux-original/drivers/pcmcia/hd64465_ss.c 2004-11-13 13:29:09.000000000 +0100 +++ linux/drivers/pcmcia/hd64465_ss.c 2004-11-14 10:38:41.691912208 +0100 @@ -922,6 +922,7 @@ hs_set_voltages(&hs_sockets[i], 0, 0); hs_sockets[i].socket.features |= SS_CAP_PCCARD | SS_CAP_STATIC_MAP; /* mappings are fixed in host memory */ + hs_sockets[i].socket.resource_ops = &pccard_static_ops; hs_sockets[i].socket.irq_mask = 0xffde;/*0xffff*/ /* IRQs mapped in s/w so can do any, really */ hs_sockets[i].socket.map_size = HD64465_PCC_WINDOW; /* 16MB fixed window size */ diff -ruN linux-original/drivers/pcmcia/i82092.c linux/drivers/pcmcia/i82092.c --- linux-original/drivers/pcmcia/i82092.c 2004-11-13 13:29:09.000000000 +0100 +++ linux/drivers/pcmcia/i82092.c 2004-11-14 10:38:41.692912056 +0100 @@ -162,6 +162,7 @@ for (i = 0; idev; sockets[i].socket.ops = &i82092aa_operations; + sockets[i].socket.resource_ops = &pccard_nonstatic_ops; ret = pcmcia_register_socket(&sockets[i].socket); if (ret) { goto err_out_free_sockets; diff -ruN linux-original/drivers/pcmcia/i82365.c linux/drivers/pcmcia/i82365.c --- linux-original/drivers/pcmcia/i82365.c 2004-11-13 13:29:09.000000000 +0100 +++ linux/drivers/pcmcia/i82365.c 2004-11-14 10:38:41.694911752 +0100 @@ -1400,6 +1400,7 @@ for (i = 0; i < sockets; i++) { socket[i].socket.dev.dev = &i82365_device.dev; socket[i].socket.ops = &pcic_operations; + socket[i].socket.resource_ops = &pccard_nonstatic_ops; socket[i].socket.owner = THIS_MODULE; socket[i].number = i; ret = pcmcia_register_socket(&socket[i].socket); diff -ruN linux-original/drivers/pcmcia/Kconfig linux/drivers/pcmcia/Kconfig --- linux-original/drivers/pcmcia/Kconfig 2004-11-14 09:01:32.000000000 +0100 +++ linux/drivers/pcmcia/Kconfig 2004-11-14 10:38:41.720907800 +0100 @@ -80,6 +80,7 @@ depends on PCCARD && PCI #fixme: remove dependendcy on CARDBUS depends on CARDBUS + select PCCARD_NONSTATIC ---help--- This option enables support for CardBus host bridges. Virtually all modern PCMCIA bridges are CardBus compatible. A "bridge" is @@ -94,6 +95,7 @@ config PD6729 tristate "Cirrus PD6729 compatible bridge support" depends on PCMCIA && PCI + select PCCARD_NONSTATIC help This provides support for the Cirrus PD6729 PCI-to-PCMCIA bridge device, found in some older laptops and PCMCIA card readers. @@ -101,6 +103,7 @@ config I82092 tristate "i82092 compatible bridge support" depends on PCMCIA && PCI + select PCCARD_NONSTATIC help This provides support for the Intel I82092AA PCI-to-PCMCIA bridge device, found in some older laptops and more commonly in evaluation boards for the @@ -109,6 +112,7 @@ config I82365 tristate "i82365 compatible bridge support" depends on PCMCIA && ISA + select PCCARD_NONSTATIC help Say Y here to include support for ISA-bus PCMCIA host bridges that are register compatible with the Intel i82365. These are found on @@ -119,6 +123,7 @@ config TCIC tristate "Databook TCIC host bridge support" depends on PCMCIA + select PCCARD_NONSTATIC help Say Y here to include support for the Databook TCIC family of PCMCIA host bridges. These are only found on a handful of old systems. @@ -178,4 +183,8 @@ help Set the number of M32R CF slots. +config PCCARD_NONSTATIC + tristate + depends on PCCARD + endmenu diff -ruN linux-original/drivers/pcmcia/m32r_cfc.c linux/drivers/pcmcia/m32r_cfc.c --- linux-original/drivers/pcmcia/m32r_cfc.c 2004-11-13 13:29:09.000000000 +0100 +++ linux/drivers/pcmcia/m32r_cfc.c 2004-11-14 10:38:41.765900960 +0100 @@ -831,6 +831,7 @@ for (i = 0 ; i < pcc_sockets ; i++) { socket[i].socket.dev.dev = &pcc_device.dev; socket[i].socket.ops = &pcc_operations; + socket[i].socket.resource_ops = &pccard_static_ops; socket[i].socket.owner = THIS_MODULE; socket[i].number = i; ret = pcmcia_register_socket(&socket[i].socket); diff -ruN linux-original/drivers/pcmcia/m32r_pcc.c linux/drivers/pcmcia/m32r_pcc.c --- linux-original/drivers/pcmcia/m32r_pcc.c 2004-11-13 13:29:09.000000000 +0100 +++ linux/drivers/pcmcia/m32r_pcc.c 2004-11-14 10:38:41.766900808 +0100 @@ -768,6 +768,7 @@ for (i = 0 ; i < pcc_sockets ; i++) { socket[i].socket.dev.dev = &pcc_device.dev; socket[i].socket.ops = &pcc_operations; + socket[i].socket.resource_ops = &pccard_static_ops; socket[i].socket.owner = THIS_MODULE; socket[i].number = i; ret = pcmcia_register_socket(&socket[i].socket); diff -ruN linux-original/drivers/pcmcia/Makefile linux/drivers/pcmcia/Makefile --- linux-original/drivers/pcmcia/Makefile 2004-11-14 10:38:10.800608400 +0100 +++ linux/drivers/pcmcia/Makefile 2004-11-14 10:38:41.767900656 +0100 @@ -6,13 +6,15 @@ EXTRA_CFLAGS += -DDEBUG endif -pcmcia_core-y += cs.o cistpl.o rsrc_mgr.o socket_sysfs.o rsrc_nonstatic.o +pcmcia_core-y += cs.o cistpl.o rsrc_mgr.o socket_sysfs.o pcmcia_core-$(CONFIG_CARDBUS) += cardbus.o obj-$(CONFIG_PCCARD) += pcmcia_core.o pcmcia-y += ds.o bulkmem.o pcmcia_compat.o obj-$(CONFIG_PCMCIA) += pcmcia.o +obj-$(CONFIG_PCCARD_NONSTATIC) += rsrc_nonstatic.o + # socket drivers diff -ruN linux-original/drivers/pcmcia/pd6729.c linux/drivers/pcmcia/pd6729.c --- linux-original/drivers/pcmcia/pd6729.c 2004-11-13 13:29:09.000000000 +0100 +++ linux/drivers/pcmcia/pd6729.c 2004-11-14 10:38:41.768900504 +0100 @@ -651,6 +651,7 @@ socket[i].number = i; socket[i].socket.ops = &pd6729_operations; + socket[i].socket.resource_ops = &pccard_nonstatic_ops; socket[i].socket.dev.dev = &dev->dev; socket[i].socket.driver_data = &socket[i]; } diff -ruN linux-original/drivers/pcmcia/rsrc_mgr.c linux/drivers/pcmcia/rsrc_mgr.c --- linux-original/drivers/pcmcia/rsrc_mgr.c 2004-11-14 10:38:10.803607944 +0100 +++ linux/drivers/pcmcia/rsrc_mgr.c 2004-11-14 10:38:41.769900352 +0100 @@ -290,3 +290,4 @@ .adjust_resource = NULL, .exit = NULL, }; +EXPORT_SYMBOL(pccard_static_ops); diff -ruN linux-original/drivers/pcmcia/rsrc_nonstatic.c linux/drivers/pcmcia/rsrc_nonstatic.c --- linux-original/drivers/pcmcia/rsrc_nonstatic.c 2004-11-14 10:38:10.833603384 +0100 +++ linux/drivers/pcmcia/rsrc_nonstatic.c 2004-11-14 10:38:41.770900200 +0100 @@ -34,6 +34,9 @@ #include #include "cs_internal.h" +MODULE_AUTHOR("David A. Hinds, Dominik Brodowski"); +MODULE_LICENSE("GPL"); + /* Parameters that can be set with 'insmod' */ #define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0444) @@ -769,3 +772,4 @@ .adjust_resource = nonstatic_adjust_resource_info, .exit = nonstatic_release_resource_db, }; +EXPORT_SYMBOL(pccard_nonstatic_ops); diff -ruN linux-original/drivers/pcmcia/soc_common.c linux/drivers/pcmcia/soc_common.c --- linux-original/drivers/pcmcia/soc_common.c 2004-11-13 13:29:09.000000000 +0100 +++ linux/drivers/pcmcia/soc_common.c 2004-11-14 10:38:41.795896400 +0100 @@ -758,6 +758,7 @@ goto out_err_6; skt->socket.features = SS_CAP_STATIC_MAP|SS_CAP_PCCARD; + skt->socket.resource_ops = &pccard_static_ops; skt->socket.irq_mask = 0; skt->socket.map_size = PAGE_SIZE; skt->socket.pci_irq = skt->irq; diff -ruN linux-original/drivers/pcmcia/tcic.c linux/drivers/pcmcia/tcic.c --- linux-original/drivers/pcmcia/tcic.c 2004-11-13 13:29:09.000000000 +0100 +++ linux/drivers/pcmcia/tcic.c 2004-11-14 10:38:41.796896248 +0100 @@ -531,8 +531,9 @@ for (i = 0; i < sockets; i++) { socket_table[i].socket.ops = &tcic_operations; + socket_table[i].socket.resource_ops = &pccard_nonstatic_ops; socket_table[i].socket.dev.dev = &tcic_device.dev; - ret = pcmcia_register_socket(&socket_table[i].socket); + ret = pcmcia_register_socket(&socket_table[i].socket); if (ret && i) pcmcia_unregister_socket(&socket_table[0].socket); } diff -ruN linux-original/drivers/pcmcia/yenta_socket.c linux/drivers/pcmcia/yenta_socket.c --- linux-original/drivers/pcmcia/yenta_socket.c 2004-11-13 13:29:09.000000000 +0100 +++ linux/drivers/pcmcia/yenta_socket.c 2004-11-14 10:38:41.798895944 +0100 @@ -914,6 +914,7 @@ /* prepare pcmcia_socket */ socket->socket.ops = ¥ta_socket_operations; + socket->socket.resource_ops = &pccard_nonstatic_ops; socket->socket.dev.dev = &dev->dev; socket->socket.driver_data = socket; socket->socket.owner = THIS_MODULE; diff -ruN linux-original/include/pcmcia/ss.h linux/include/pcmcia/ss.h --- linux-original/include/pcmcia/ss.h 2004-11-14 10:37:43.073823512 +0100 +++ linux/include/pcmcia/ss.h 2004-11-14 10:38:41.799895792 +0100 @@ -131,6 +131,10 @@ adjust_t *adj); void (*exit) (struct pcmcia_socket *s); }; +/* SS_CAP_STATIC_MAP */ +extern struct pccard_resource_ops pccard_static_ops; +/* !SS_CAP_STATIC_MAP */ +extern struct pccard_resource_ops pccard_nonstatic_ops; /* * Calls to set up low-level "Socket Services" drivers