Commit e6ea0b9e authored by Dominik Brodowski's avatar Dominik Brodowski Committed by Linus Torvalds

[PATCH] pcmcia: rename some functions

Rename some functions in drivers/pcmcia/ to show they belong to the PCMCIA
subsystem.
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3b659fb8
...@@ -90,7 +90,7 @@ set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flag ...@@ -90,7 +90,7 @@ set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flag
{ {
pccard_mem_map *mem = &s->cis_mem; pccard_mem_map *mem = &s->cis_mem;
if (!(s->features & SS_CAP_STATIC_MAP) && mem->res == NULL) { if (!(s->features & SS_CAP_STATIC_MAP) && mem->res == NULL) {
mem->res = find_mem_region(0, s->map_size, s->map_size, 0, s); mem->res = pcmcia_find_mem_region(0, s->map_size, s->map_size, 0, s);
if (mem->res == NULL) { if (mem->res == NULL) {
printk(KERN_NOTICE "cs: unable to map card memory!\n"); printk(KERN_NOTICE "cs: unable to map card memory!\n");
return NULL; return NULL;
...@@ -119,13 +119,13 @@ set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flag ...@@ -119,13 +119,13 @@ set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flag
#define IS_ATTR 1 #define IS_ATTR 1
#define IS_INDIRECT 8 #define IS_INDIRECT 8
int read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr, int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
u_int len, void *ptr) u_int len, void *ptr)
{ {
void __iomem *sys, *end; void __iomem *sys, *end;
unsigned char *buf = ptr; unsigned char *buf = ptr;
cs_dbg(s, 3, "read_cis_mem(%d, %#x, %u)\n", attr, addr, len); cs_dbg(s, 3, "pcmcia_read_cis_mem(%d, %#x, %u)\n", attr, addr, len);
if (attr & IS_INDIRECT) { if (attr & IS_INDIRECT) {
/* Indirect accesses use a bunch of special registers at fixed /* Indirect accesses use a bunch of special registers at fixed
...@@ -183,13 +183,13 @@ int read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr, ...@@ -183,13 +183,13 @@ int read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
return 0; return 0;
} }
void write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr, void pcmcia_write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
u_int len, void *ptr) u_int len, void *ptr)
{ {
void __iomem *sys, *end; void __iomem *sys, *end;
unsigned char *buf = ptr; unsigned char *buf = ptr;
cs_dbg(s, 3, "write_cis_mem(%d, %#x, %u)\n", attr, addr, len); cs_dbg(s, 3, "pcmcia_write_cis_mem(%d, %#x, %u)\n", attr, addr, len);
if (attr & IS_INDIRECT) { if (attr & IS_INDIRECT) {
/* Indirect accesses use a bunch of special registers at fixed /* Indirect accesses use a bunch of special registers at fixed
...@@ -274,7 +274,7 @@ static void read_cis_cache(struct pcmcia_socket *s, int attr, u_int addr, ...@@ -274,7 +274,7 @@ static void read_cis_cache(struct pcmcia_socket *s, int attr, u_int addr,
ret = read_cb_mem(s, attr, addr, len, ptr); ret = read_cb_mem(s, attr, addr, len, ptr);
else else
#endif #endif
ret = read_cis_mem(s, attr, addr, len, ptr); ret = pcmcia_read_cis_mem(s, attr, addr, len, ptr);
if (ret == 0) { if (ret == 0) {
/* Copy data into the cache */ /* Copy data into the cache */
...@@ -348,7 +348,7 @@ int verify_cis_cache(struct pcmcia_socket *s) ...@@ -348,7 +348,7 @@ int verify_cis_cache(struct pcmcia_socket *s)
read_cb_mem(s, cis->attr, cis->addr, len, buf); read_cb_mem(s, cis->attr, cis->addr, len, buf);
else else
#endif #endif
read_cis_mem(s, cis->attr, cis->addr, len, buf); pcmcia_read_cis_mem(s, cis->attr, cis->addr, len, buf);
if (memcmp(buf, cis->cache, len) != 0) { if (memcmp(buf, cis->cache, len) != 0) {
kfree(buf); kfree(buf);
......
...@@ -787,7 +787,7 @@ static int alloc_io_space(struct pcmcia_socket *s, u_int attr, ioaddr_t *base, ...@@ -787,7 +787,7 @@ static int alloc_io_space(struct pcmcia_socket *s, u_int attr, ioaddr_t *base,
return 1; return 1;
for (i = 0; i < MAX_IO_WIN; i++) { for (i = 0; i < MAX_IO_WIN; i++) {
if (s->io[i].NumPorts == 0) { if (s->io[i].NumPorts == 0) {
s->io[i].res = find_io_region(*base, num, align, s); s->io[i].res = pcmcia_find_io_region(*base, num, align, s);
if (s->io[i].res) { if (s->io[i].res) {
s->io[i].Attributes = attr; s->io[i].Attributes = attr;
s->io[i].BasePort = *base = s->io[i].res->start; s->io[i].BasePort = *base = s->io[i].res->start;
...@@ -800,7 +800,7 @@ static int alloc_io_space(struct pcmcia_socket *s, u_int attr, ioaddr_t *base, ...@@ -800,7 +800,7 @@ static int alloc_io_space(struct pcmcia_socket *s, u_int attr, ioaddr_t *base,
/* Try to extend top of window */ /* Try to extend top of window */
try = s->io[i].BasePort + s->io[i].NumPorts; try = s->io[i].BasePort + s->io[i].NumPorts;
if ((*base == 0) || (*base == try)) if ((*base == 0) || (*base == try))
if (adjust_io_region(s->io[i].res, s->io[i].res->start, if (pcmcia_adjust_io_region(s->io[i].res, s->io[i].res->start,
s->io[i].res->end + num, s) == 0) { s->io[i].res->end + num, s) == 0) {
*base = try; *base = try;
s->io[i].NumPorts += num; s->io[i].NumPorts += num;
...@@ -810,7 +810,7 @@ static int alloc_io_space(struct pcmcia_socket *s, u_int attr, ioaddr_t *base, ...@@ -810,7 +810,7 @@ static int alloc_io_space(struct pcmcia_socket *s, u_int attr, ioaddr_t *base,
/* Try to extend bottom of window */ /* Try to extend bottom of window */
try = s->io[i].BasePort - num; try = s->io[i].BasePort - num;
if ((*base == 0) || (*base == try)) if ((*base == 0) || (*base == try))
if (adjust_io_region(s->io[i].res, s->io[i].res->start - num, if (pcmcia_adjust_io_region(s->io[i].res, s->io[i].res->start - num,
s->io[i].res->end, s) == 0) { s->io[i].res->end, s) == 0) {
s->io[i].BasePort = *base = try; s->io[i].BasePort = *base = try;
s->io[i].NumPorts += num; s->io[i].NumPorts += num;
...@@ -872,12 +872,12 @@ int pccard_access_configuration_register(struct pcmcia_socket *s, ...@@ -872,12 +872,12 @@ int pccard_access_configuration_register(struct pcmcia_socket *s,
switch (reg->Action) { switch (reg->Action) {
case CS_READ: case CS_READ:
read_cis_mem(s, 1, addr, 1, &val); pcmcia_read_cis_mem(s, 1, addr, 1, &val);
reg->Value = val; reg->Value = val;
break; break;
case CS_WRITE: case CS_WRITE:
val = reg->Value; val = reg->Value;
write_cis_mem(s, 1, addr, 1, &val); pcmcia_write_cis_mem(s, 1, addr, 1, &val);
break; break;
default: default:
return CS_BAD_ARGS; return CS_BAD_ARGS;
...@@ -1050,7 +1050,7 @@ int pccard_get_status(struct pcmcia_socket *s, unsigned int function, cs_status_ ...@@ -1050,7 +1050,7 @@ int pccard_get_status(struct pcmcia_socket *s, unsigned int function, cs_status_
(c->IntType & (INT_MEMORY_AND_IO | INT_ZOOMED_VIDEO))) { (c->IntType & (INT_MEMORY_AND_IO | INT_ZOOMED_VIDEO))) {
u_char reg; u_char reg;
if (c->Present & PRESENT_PIN_REPLACE) { if (c->Present & PRESENT_PIN_REPLACE) {
read_cis_mem(s, 1, (c->ConfigBase+CISREG_PRR)>>1, 1, &reg); pcmcia_read_cis_mem(s, 1, (c->ConfigBase+CISREG_PRR)>>1, 1, &reg);
status->CardState |= status->CardState |=
(reg & PRR_WP_STATUS) ? CS_EVENT_WRITE_PROTECT : 0; (reg & PRR_WP_STATUS) ? CS_EVENT_WRITE_PROTECT : 0;
status->CardState |= status->CardState |=
...@@ -1064,7 +1064,7 @@ int pccard_get_status(struct pcmcia_socket *s, unsigned int function, cs_status_ ...@@ -1064,7 +1064,7 @@ int pccard_get_status(struct pcmcia_socket *s, unsigned int function, cs_status_
status->CardState |= CS_EVENT_READY_CHANGE; status->CardState |= CS_EVENT_READY_CHANGE;
} }
if (c->Present & PRESENT_EXT_STATUS) { if (c->Present & PRESENT_EXT_STATUS) {
read_cis_mem(s, 1, (c->ConfigBase+CISREG_ESR)>>1, 1, &reg); pcmcia_read_cis_mem(s, 1, (c->ConfigBase+CISREG_ESR)>>1, 1, &reg);
status->CardState |= status->CardState |=
(reg & ESR_REQ_ATTN) ? CS_EVENT_REQUEST_ATTENTION : 0; (reg & ESR_REQ_ATTN) ? CS_EVENT_REQUEST_ATTENTION : 0;
} }
...@@ -1401,7 +1401,7 @@ int pcmcia_request_configuration(client_handle_t handle, ...@@ -1401,7 +1401,7 @@ int pcmcia_request_configuration(client_handle_t handle,
c->Present = c->CardValues = req->Present; c->Present = c->CardValues = req->Present;
if (req->Present & PRESENT_COPY) { if (req->Present & PRESENT_COPY) {
c->Copy = req->Copy; c->Copy = req->Copy;
write_cis_mem(s, 1, (base + CISREG_SCR)>>1, 1, &c->Copy); pcmcia_write_cis_mem(s, 1, (base + CISREG_SCR)>>1, 1, &c->Copy);
} }
if (req->Present & PRESENT_OPTION) { if (req->Present & PRESENT_OPTION) {
if (s->functions == 1) { if (s->functions == 1) {
...@@ -1415,30 +1415,30 @@ int pcmcia_request_configuration(client_handle_t handle, ...@@ -1415,30 +1415,30 @@ int pcmcia_request_configuration(client_handle_t handle,
if (c->state & CONFIG_IRQ_REQ) if (c->state & CONFIG_IRQ_REQ)
if (!(c->irq.Attributes & IRQ_FORCED_PULSE)) if (!(c->irq.Attributes & IRQ_FORCED_PULSE))
c->Option |= COR_LEVEL_REQ; c->Option |= COR_LEVEL_REQ;
write_cis_mem(s, 1, (base + CISREG_COR)>>1, 1, &c->Option); pcmcia_write_cis_mem(s, 1, (base + CISREG_COR)>>1, 1, &c->Option);
mdelay(40); mdelay(40);
} }
if (req->Present & PRESENT_STATUS) { if (req->Present & PRESENT_STATUS) {
c->Status = req->Status; c->Status = req->Status;
write_cis_mem(s, 1, (base + CISREG_CCSR)>>1, 1, &c->Status); pcmcia_write_cis_mem(s, 1, (base + CISREG_CCSR)>>1, 1, &c->Status);
} }
if (req->Present & PRESENT_PIN_REPLACE) { if (req->Present & PRESENT_PIN_REPLACE) {
c->Pin = req->Pin; c->Pin = req->Pin;
write_cis_mem(s, 1, (base + CISREG_PRR)>>1, 1, &c->Pin); pcmcia_write_cis_mem(s, 1, (base + CISREG_PRR)>>1, 1, &c->Pin);
} }
if (req->Present & PRESENT_EXT_STATUS) { if (req->Present & PRESENT_EXT_STATUS) {
c->ExtStatus = req->ExtStatus; c->ExtStatus = req->ExtStatus;
write_cis_mem(s, 1, (base + CISREG_ESR)>>1, 1, &c->ExtStatus); pcmcia_write_cis_mem(s, 1, (base + CISREG_ESR)>>1, 1, &c->ExtStatus);
} }
if (req->Present & PRESENT_IOBASE_0) { if (req->Present & PRESENT_IOBASE_0) {
u_char b = c->io.BasePort1 & 0xff; u_char b = c->io.BasePort1 & 0xff;
write_cis_mem(s, 1, (base + CISREG_IOBASE_0)>>1, 1, &b); pcmcia_write_cis_mem(s, 1, (base + CISREG_IOBASE_0)>>1, 1, &b);
b = (c->io.BasePort1 >> 8) & 0xff; b = (c->io.BasePort1 >> 8) & 0xff;
write_cis_mem(s, 1, (base + CISREG_IOBASE_1)>>1, 1, &b); pcmcia_write_cis_mem(s, 1, (base + CISREG_IOBASE_1)>>1, 1, &b);
} }
if (req->Present & PRESENT_IOSIZE) { if (req->Present & PRESENT_IOSIZE) {
u_char b = c->io.NumPorts1 + c->io.NumPorts2 - 1; u_char b = c->io.NumPorts1 + c->io.NumPorts2 - 1;
write_cis_mem(s, 1, (base + CISREG_IOSIZE)>>1, 1, &b); pcmcia_write_cis_mem(s, 1, (base + CISREG_IOSIZE)>>1, 1, &b);
} }
/* Configure I/O windows */ /* Configure I/O windows */
...@@ -1678,7 +1678,7 @@ int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle ...@@ -1678,7 +1678,7 @@ int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle
win->sock = s; win->sock = s;
if (!(s->features & SS_CAP_STATIC_MAP)) { if (!(s->features & SS_CAP_STATIC_MAP)) {
win->ctl.res = find_mem_region(req->Base, req->Size, align, win->ctl.res = pcmcia_find_mem_region(req->Base, req->Size, align,
(req->Attributes & WIN_MAP_BELOW_1MB), s); (req->Attributes & WIN_MAP_BELOW_1MB), s);
if (!win->ctl.res) if (!win->ctl.res)
return CS_IN_USE; return CS_IN_USE;
......
...@@ -123,9 +123,9 @@ void cb_free(struct pcmcia_socket *s); ...@@ -123,9 +123,9 @@ void cb_free(struct pcmcia_socket *s);
int read_cb_mem(struct pcmcia_socket *s, int space, u_int addr, u_int len, void *ptr); int read_cb_mem(struct pcmcia_socket *s, int space, u_int addr, u_int len, void *ptr);
/* In cistpl.c */ /* In cistpl.c */
int read_cis_mem(struct pcmcia_socket *s, int attr, int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr,
u_int addr, u_int len, void *ptr); u_int addr, u_int len, void *ptr);
void write_cis_mem(struct pcmcia_socket *s, int attr, void pcmcia_write_cis_mem(struct pcmcia_socket *s, int attr,
u_int addr, u_int len, void *ptr); u_int addr, u_int len, void *ptr);
void release_cis_mem(struct pcmcia_socket *s); void release_cis_mem(struct pcmcia_socket *s);
void destroy_cis_cache(struct pcmcia_socket *s); void destroy_cis_cache(struct pcmcia_socket *s);
...@@ -134,13 +134,12 @@ int pccard_read_tuple(struct pcmcia_socket *s, unsigned int function, cisdata_t ...@@ -134,13 +134,12 @@ int pccard_read_tuple(struct pcmcia_socket *s, unsigned int function, cisdata_t
/* In rsrc_mgr */ /* In rsrc_mgr */
void pcmcia_validate_mem(struct pcmcia_socket *s); void pcmcia_validate_mem(struct pcmcia_socket *s);
struct resource *find_io_region(unsigned long base, int num, unsigned long align, struct resource *pcmcia_find_io_region(unsigned long base, int num, unsigned long align,
struct pcmcia_socket *s); struct pcmcia_socket *s);
int adjust_io_region(struct resource *res, unsigned long r_start, int pcmcia_adjust_io_region(struct resource *res, unsigned long r_start,
unsigned long r_end, struct pcmcia_socket *s); unsigned long r_end, struct pcmcia_socket *s);
struct resource *find_mem_region(u_long base, u_long num, u_long align, struct resource *pcmcia_find_mem_region(u_long base, u_long num, u_long align,
int low, struct pcmcia_socket *s); int low, struct pcmcia_socket *s);
int adjust_resource_info(client_handle_t handle, adjust_t *adj);
void release_resource_db(struct pcmcia_socket *s); void release_resource_db(struct pcmcia_socket *s);
/* In socket_sysfs.c */ /* In socket_sysfs.c */
......
...@@ -105,7 +105,7 @@ void pcmcia_validate_mem(struct pcmcia_socket *s) ...@@ -105,7 +105,7 @@ void pcmcia_validate_mem(struct pcmcia_socket *s)
} }
EXPORT_SYMBOL(pcmcia_validate_mem); EXPORT_SYMBOL(pcmcia_validate_mem);
int adjust_io_region(struct resource *res, unsigned long r_start, int pcmcia_adjust_io_region(struct resource *res, unsigned long r_start,
unsigned long r_end, struct pcmcia_socket *s) unsigned long r_end, struct pcmcia_socket *s)
{ {
if (s->resource_ops->adjust_io_region) if (s->resource_ops->adjust_io_region)
...@@ -113,7 +113,7 @@ int adjust_io_region(struct resource *res, unsigned long r_start, ...@@ -113,7 +113,7 @@ int adjust_io_region(struct resource *res, unsigned long r_start,
return -ENOMEM; return -ENOMEM;
} }
struct resource *find_io_region(unsigned long base, int num, struct resource *pcmcia_find_io_region(unsigned long base, int num,
unsigned long align, struct pcmcia_socket *s) unsigned long align, struct pcmcia_socket *s)
{ {
if (s->resource_ops->find_io) if (s->resource_ops->find_io)
...@@ -121,7 +121,7 @@ struct resource *find_io_region(unsigned long base, int num, ...@@ -121,7 +121,7 @@ struct resource *find_io_region(unsigned long base, int num,
return NULL; return NULL;
} }
struct resource *find_mem_region(u_long base, u_long num, u_long align, struct resource *pcmcia_find_mem_region(u_long base, u_long num, u_long align,
int low, struct pcmcia_socket *s) int low, struct pcmcia_socket *s)
{ {
if (s->resource_ops->find_mem) if (s->resource_ops->find_mem)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment