Merge tag 'char-misc-4.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc fixes from Greg KH:
"Here are three fixes for 4.0-rc5 that revert 3 PCMCIA patches that
were merged in 4.0-rc1 that cause regressions. So let's revert them
for now and they will be reworked and resent sometime in the future.

All have been tested in linux-next for a while"

* tag 'char-misc-4.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
Revert "pcmcia: add a new resource manager for non ISA systems"
Revert "pcmcia: fix incorrect bracketing on a test"
Revert "pcmcia: add missing include for new pci resource handler"

Changed files
+3 -183
drivers
+3 -9
drivers/pcmcia/Kconfig
··· 69 69 tristate "CardBus yenta-compatible bridge support" 70 70 depends on PCI 71 71 select CARDBUS if !EXPERT 72 - select PCCARD_NONSTATIC if PCMCIA != n && ISA 73 - select PCCARD_PCI if PCMCIA !=n && !ISA 72 + select PCCARD_NONSTATIC if PCMCIA != n 74 73 ---help--- 75 74 This option enables support for CardBus host bridges. Virtually 76 75 all modern PCMCIA bridges are CardBus compatible. A "bridge" is ··· 109 110 config PD6729 110 111 tristate "Cirrus PD6729 compatible bridge support" 111 112 depends on PCMCIA && PCI 112 - select PCCARD_NONSTATIC if PCMCIA != n && ISA 113 - select PCCARD_PCI if PCMCIA !=n && !ISA 113 + select PCCARD_NONSTATIC 114 114 help 115 115 This provides support for the Cirrus PD6729 PCI-to-PCMCIA bridge 116 116 device, found in some older laptops and PCMCIA card readers. ··· 117 119 config I82092 118 120 tristate "i82092 compatible bridge support" 119 121 depends on PCMCIA && PCI 120 - select PCCARD_NONSTATIC if PCMCIA != n && ISA 121 - select PCCARD_PCI if PCMCIA !=n && !ISA 122 + select PCCARD_NONSTATIC 122 123 help 123 124 This provides support for the Intel I82092AA PCI-to-PCMCIA bridge device, 124 125 found in some older laptops and more commonly in evaluation boards for the ··· 287 290 help 288 291 Say Y here to support the CompactFlash controller on the 289 292 PA Semi Electra eval board. 290 - 291 - config PCCARD_PCI 292 - bool 293 293 294 294 config PCCARD_NONSTATIC 295 295 bool
-1
drivers/pcmcia/Makefile
··· 12 12 pcmcia_rsrc-y += rsrc_mgr.o 13 13 pcmcia_rsrc-$(CONFIG_PCCARD_NONSTATIC) += rsrc_nonstatic.o 14 14 pcmcia_rsrc-$(CONFIG_PCCARD_IODYN) += rsrc_iodyn.o 15 - pcmcia_rsrc-$(CONFIG_PCCARD_PCI) += rsrc_pci.o 16 15 obj-$(CONFIG_PCCARD) += pcmcia_rsrc.o 17 16 18 17
-173
drivers/pcmcia/rsrc_pci.c
··· 1 - #include <linux/slab.h> 2 - #include <linux/module.h> 3 - #include <linux/kernel.h> 4 - #include <linux/pci.h> 5 - 6 - #include <pcmcia/ss.h> 7 - #include <pcmcia/cistpl.h> 8 - #include "cs_internal.h" 9 - 10 - 11 - struct pcmcia_align_data { 12 - unsigned long mask; 13 - unsigned long offset; 14 - }; 15 - 16 - static resource_size_t pcmcia_align(void *align_data, 17 - const struct resource *res, 18 - resource_size_t size, resource_size_t align) 19 - { 20 - struct pcmcia_align_data *data = align_data; 21 - resource_size_t start; 22 - 23 - start = (res->start & ~data->mask) + data->offset; 24 - if (start < res->start) 25 - start += data->mask + 1; 26 - return start; 27 - } 28 - 29 - static struct resource *find_io_region(struct pcmcia_socket *s, 30 - unsigned long base, int num, 31 - unsigned long align) 32 - { 33 - struct resource *res = pcmcia_make_resource(0, num, IORESOURCE_IO, 34 - dev_name(&s->dev)); 35 - struct pcmcia_align_data data; 36 - int ret; 37 - 38 - data.mask = align - 1; 39 - data.offset = base & data.mask; 40 - 41 - ret = pci_bus_alloc_resource(s->cb_dev->bus, res, num, 1, 42 - base, 0, pcmcia_align, &data); 43 - if (ret != 0) { 44 - kfree(res); 45 - res = NULL; 46 - } 47 - return res; 48 - } 49 - 50 - static int res_pci_find_io(struct pcmcia_socket *s, unsigned int attr, 51 - unsigned int *base, unsigned int num, 52 - unsigned int align, struct resource **parent) 53 - { 54 - int i, ret = 0; 55 - 56 - /* Check for an already-allocated window that must conflict with 57 - * what was asked for. It is a hack because it does not catch all 58 - * potential conflicts, just the most obvious ones. 59 - */ 60 - for (i = 0; i < MAX_IO_WIN; i++) { 61 - if (!s->io[i].res) 62 - continue; 63 - 64 - if (!*base) 65 - continue; 66 - 67 - if ((s->io[i].res->start & (align-1)) == *base) 68 - return -EBUSY; 69 - } 70 - 71 - for (i = 0; i < MAX_IO_WIN; i++) { 72 - struct resource *res = s->io[i].res; 73 - unsigned int try; 74 - 75 - if (res && (res->flags & IORESOURCE_BITS) != 76 - (attr & IORESOURCE_BITS)) 77 - continue; 78 - 79 - if (!res) { 80 - if (align == 0) 81 - align = 0x10000; 82 - 83 - res = s->io[i].res = find_io_region(s, *base, num, 84 - align); 85 - if (!res) 86 - return -EINVAL; 87 - 88 - *base = res->start; 89 - s->io[i].res->flags = 90 - ((res->flags & ~IORESOURCE_BITS) | 91 - (attr & IORESOURCE_BITS)); 92 - s->io[i].InUse = num; 93 - *parent = res; 94 - return 0; 95 - } 96 - 97 - /* Try to extend top of window */ 98 - try = res->end + 1; 99 - if ((*base == 0) || (*base == try)) { 100 - ret = adjust_resource(s->io[i].res, res->start, 101 - resource_size(res) + num); 102 - if (ret) 103 - continue; 104 - *base = try; 105 - s->io[i].InUse += num; 106 - *parent = res; 107 - return 0; 108 - } 109 - 110 - /* Try to extend bottom of window */ 111 - try = res->start - num; 112 - if ((*base == 0) || (*base == try)) { 113 - ret = adjust_resource(s->io[i].res, 114 - res->start - num, 115 - resource_size(res) + num); 116 - if (ret) 117 - continue; 118 - *base = try; 119 - s->io[i].InUse += num; 120 - *parent = res; 121 - return 0; 122 - } 123 - } 124 - return -EINVAL; 125 - } 126 - 127 - static struct resource *res_pci_find_mem(u_long base, u_long num, 128 - u_long align, int low, struct pcmcia_socket *s) 129 - { 130 - struct resource *res = pcmcia_make_resource(0, num, IORESOURCE_MEM, 131 - dev_name(&s->dev)); 132 - struct pcmcia_align_data data; 133 - unsigned long min; 134 - int ret; 135 - 136 - if (align < 0x20000) 137 - align = 0x20000; 138 - data.mask = align - 1; 139 - data.offset = base & data.mask; 140 - 141 - min = 0; 142 - if (!low) 143 - min = 0x100000UL; 144 - 145 - ret = pci_bus_alloc_resource(s->cb_dev->bus, 146 - res, num, 1, min, 0, 147 - pcmcia_align, &data); 148 - 149 - if (ret != 0) { 150 - kfree(res); 151 - res = NULL; 152 - } 153 - return res; 154 - } 155 - 156 - 157 - static int res_pci_init(struct pcmcia_socket *s) 158 - { 159 - if (!s->cb_dev || !(s->features & SS_CAP_PAGE_REGS)) { 160 - dev_err(&s->dev, "not supported by res_pci\n"); 161 - return -EOPNOTSUPP; 162 - } 163 - return 0; 164 - } 165 - 166 - struct pccard_resource_ops pccard_nonstatic_ops = { 167 - .validate_mem = NULL, 168 - .find_io = res_pci_find_io, 169 - .find_mem = res_pci_find_mem, 170 - .init = res_pci_init, 171 - .exit = NULL, 172 - }; 173 - EXPORT_SYMBOL(pccard_nonstatic_ops);