1 // SPDX-License-Identifier: GPL-2.0-only
3 * rsrc_mgr.c -- Resource management routines and/or wrappers
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.
9 * (C) 1999 David A. Hinds
12 #include <linux/slab.h>
13 #include <linux/module.h>
14 #include <linux/kernel.h>
16 #include <pcmcia/ss.h>
17 #include <pcmcia/cistpl.h>
18 #include "cs_internal.h"
20 int static_init(struct pcmcia_socket *s)
22 /* the good thing about SS_CAP_STATIC_MAP sockets is
23 * that they don't need a resource database */
25 s->resource_setup_done = 1;
30 struct resource *pcmcia_make_resource(resource_size_t start,
32 unsigned long flags, const char *name)
34 struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL);
39 res->end = start + end - 1;
45 static int static_find_io(struct pcmcia_socket *s, unsigned int attr,
46 unsigned int *base, unsigned int num,
47 unsigned int align, struct resource **parent)
51 *base = s->io_offset | (*base & 0x0fff);
58 struct pccard_resource_ops pccard_static_ops = {
60 .find_io = static_find_io,
65 EXPORT_SYMBOL(pccard_static_ops);
68 MODULE_AUTHOR("David A. Hinds, Dominik Brodowski");
69 MODULE_LICENSE("GPL");
70 MODULE_ALIAS("rsrc_nonstatic");