Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pcmcia: remove PCCARD_IODYN

The config PCCARD_IODYN was last used in the config option PCMCIA_M8XX with
its m8xx_pcmcia driver. This driver was removed with commit 39eb56da2b53
("pcmcia: Remove m8xx_pcmcia driver"), included in v3.17, back in 2014.
Since then, the config PCCARD_IODYN is unused. Remove the config option,
the corresponding file included with this config and the corresponding
definition in the pcmcia header file.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@redhat.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>

authored by

Lukas Bulwahn and committed by
Dominik Brodowski
4bf1541e ce0e8efb

+1 -182
-3
drivers/pcmcia/Kconfig
··· 250 250 config PCCARD_NONSTATIC 251 251 bool 252 252 253 - config PCCARD_IODYN 254 - bool 255 - 256 253 endif # PCCARD
-1
drivers/pcmcia/Makefile
··· 12 12 13 13 pcmcia_rsrc-y += rsrc_mgr.o 14 14 pcmcia_rsrc-$(CONFIG_PCCARD_NONSTATIC) += rsrc_nonstatic.o 15 - pcmcia_rsrc-$(CONFIG_PCCARD_IODYN) += rsrc_iodyn.o 16 15 obj-$(CONFIG_PCCARD) += pcmcia_rsrc.o 17 16 18 17
-171
drivers/pcmcia/rsrc_iodyn.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * rsrc_iodyn.c -- Resource management routines for MEM-static sockets. 4 - * 5 - * The initial developer of the original code is David A. Hinds 6 - * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds 7 - * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. 8 - * 9 - * (C) 1999 David A. Hinds 10 - */ 11 - 12 - #include <linux/slab.h> 13 - #include <linux/module.h> 14 - #include <linux/kernel.h> 15 - 16 - #include <pcmcia/ss.h> 17 - #include <pcmcia/cistpl.h> 18 - #include "cs_internal.h" 19 - 20 - 21 - struct pcmcia_align_data { 22 - unsigned long mask; 23 - unsigned long offset; 24 - }; 25 - 26 - static resource_size_t pcmcia_align(void *align_data, 27 - const struct resource *res, 28 - resource_size_t size, resource_size_t align) 29 - { 30 - struct pcmcia_align_data *data = align_data; 31 - resource_size_t start; 32 - 33 - start = (res->start & ~data->mask) + data->offset; 34 - if (start < res->start) 35 - start += data->mask + 1; 36 - 37 - #ifdef CONFIG_X86 38 - if (res->flags & IORESOURCE_IO) { 39 - if (start & 0x300) 40 - start = (start + 0x3ff) & ~0x3ff; 41 - } 42 - #endif 43 - 44 - #ifdef CONFIG_M68K 45 - if (res->flags & IORESOURCE_IO) { 46 - if ((res->start + size - 1) >= 1024) 47 - start = res->end; 48 - } 49 - #endif 50 - 51 - return start; 52 - } 53 - 54 - 55 - static struct resource *__iodyn_find_io_region(struct pcmcia_socket *s, 56 - unsigned long base, int num, 57 - unsigned long align) 58 - { 59 - struct resource *res = pcmcia_make_resource(0, num, IORESOURCE_IO, 60 - dev_name(&s->dev)); 61 - struct pcmcia_align_data data; 62 - unsigned long min = base; 63 - int ret; 64 - 65 - if (!res) 66 - return NULL; 67 - 68 - data.mask = align - 1; 69 - data.offset = base & data.mask; 70 - 71 - #ifdef CONFIG_PCI 72 - if (s->cb_dev) { 73 - ret = pci_bus_alloc_resource(s->cb_dev->bus, res, num, 1, 74 - min, 0, pcmcia_align, &data); 75 - } else 76 - #endif 77 - ret = allocate_resource(&ioport_resource, res, num, min, ~0UL, 78 - 1, pcmcia_align, &data); 79 - 80 - if (ret != 0) { 81 - kfree(res); 82 - res = NULL; 83 - } 84 - return res; 85 - } 86 - 87 - static int iodyn_find_io(struct pcmcia_socket *s, unsigned int attr, 88 - unsigned int *base, unsigned int num, 89 - unsigned int align, struct resource **parent) 90 - { 91 - int i, ret = 0; 92 - 93 - /* Check for an already-allocated window that must conflict with 94 - * what was asked for. It is a hack because it does not catch all 95 - * potential conflicts, just the most obvious ones. 96 - */ 97 - for (i = 0; i < MAX_IO_WIN; i++) { 98 - if (!s->io[i].res) 99 - continue; 100 - 101 - if (!*base) 102 - continue; 103 - 104 - if ((s->io[i].res->start & (align-1)) == *base) 105 - return -EBUSY; 106 - } 107 - 108 - for (i = 0; i < MAX_IO_WIN; i++) { 109 - struct resource *res = s->io[i].res; 110 - unsigned int try; 111 - 112 - if (res && (res->flags & IORESOURCE_BITS) != 113 - (attr & IORESOURCE_BITS)) 114 - continue; 115 - 116 - if (!res) { 117 - if (align == 0) 118 - align = 0x10000; 119 - 120 - res = s->io[i].res = __iodyn_find_io_region(s, *base, 121 - num, align); 122 - if (!res) 123 - return -EINVAL; 124 - 125 - *base = res->start; 126 - s->io[i].res->flags = 127 - ((res->flags & ~IORESOURCE_BITS) | 128 - (attr & IORESOURCE_BITS)); 129 - s->io[i].InUse = num; 130 - *parent = res; 131 - return 0; 132 - } 133 - 134 - /* Try to extend top of window */ 135 - try = res->end + 1; 136 - if ((*base == 0) || (*base == try)) { 137 - if (adjust_resource(s->io[i].res, res->start, 138 - resource_size(res) + num)) 139 - continue; 140 - *base = try; 141 - s->io[i].InUse += num; 142 - *parent = res; 143 - return 0; 144 - } 145 - 146 - /* Try to extend bottom of window */ 147 - try = res->start - num; 148 - if ((*base == 0) || (*base == try)) { 149 - if (adjust_resource(s->io[i].res, 150 - res->start - num, 151 - resource_size(res) + num)) 152 - continue; 153 - *base = try; 154 - s->io[i].InUse += num; 155 - *parent = res; 156 - return 0; 157 - } 158 - } 159 - 160 - return -EINVAL; 161 - } 162 - 163 - 164 - struct pccard_resource_ops pccard_iodyn_ops = { 165 - .validate_mem = NULL, 166 - .find_io = iodyn_find_io, 167 - .find_mem = NULL, 168 - .init = static_init, 169 - .exit = NULL, 170 - }; 171 - EXPORT_SYMBOL(pccard_iodyn_ops);
+1 -7
include/pcmcia/ss.h
··· 227 227 228 228 229 229 /* socket drivers must define the resource operations type they use. There 230 - * are three options: 230 + * are two options: 231 231 * - pccard_static_ops iomem and ioport areas are assigned statically 232 - * - pccard_iodyn_ops iomem areas is assigned statically, ioport 233 - * areas dynamically 234 - * If this option is selected, use 235 - * "select PCCARD_IODYN" in Kconfig. 236 232 * - pccard_nonstatic_ops iomem and ioport areas are assigned dynamically. 237 233 * If this option is selected, use 238 234 * "select PCCARD_NONSTATIC" in Kconfig. ··· 236 240 */ 237 241 extern struct pccard_resource_ops pccard_static_ops; 238 242 #if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE) 239 - extern struct pccard_resource_ops pccard_iodyn_ops; 240 243 extern struct pccard_resource_ops pccard_nonstatic_ops; 241 244 #else 242 245 /* If PCMCIA is not used, but only CARDBUS, these functions are not used 243 246 * at all. Therefore, do not use the large (240K!) rsrc_nonstatic module 244 247 */ 245 - #define pccard_iodyn_ops pccard_static_ops 246 248 #define pccard_nonstatic_ops pccard_static_ops 247 249 #endif 248 250