Commit 41c5d533 authored by Russell King's avatar Russell King

[PCMCIA] Make cb_release_cis_mem() local to cardbus.c

The cardbus CIS parsing code does not use the PCMCIA resource
subsystem, so there isn't any point in freeing its memory when
we remove PCMCIA memory resources.  We also free CIS resources
immediately prior to calling cb_free().  We might as well move
the function call into cb_free(), thereby making all references
to cb_release_cis_mem() local to cardbus.c
parent 4de24fcf
...@@ -123,7 +123,7 @@ static u_int xlate_rom_addr(u_char * b, u_int addr) ...@@ -123,7 +123,7 @@ static u_int xlate_rom_addr(u_char * b, u_int addr)
=====================================================================*/ =====================================================================*/
void cb_release_cis_mem(socket_info_t * s) static void cb_release_cis_mem(socket_info_t * s)
{ {
if (s->cb_cis_virt) { if (s->cb_cis_virt) {
DEBUG(1, "cs: cb_release_cis_mem()\n"); DEBUG(1, "cs: cb_release_cis_mem()\n");
...@@ -270,6 +270,8 @@ void cb_free(socket_info_t * s) ...@@ -270,6 +270,8 @@ void cb_free(socket_info_t * s)
{ {
struct pci_dev *bridge = s->cap.cb_dev; struct pci_dev *bridge = s->cap.cb_dev;
cb_release_cis_mem(s);
if (bridge) if (bridge)
pci_remove_behind_bridge(bridge); pci_remove_behind_bridge(bridge);
} }
...@@ -485,7 +485,6 @@ static void shutdown_socket(socket_info_t *s) ...@@ -485,7 +485,6 @@ static void shutdown_socket(socket_info_t *s)
set_socket(s, &s->socket); set_socket(s, &s->socket);
/* */ /* */
#ifdef CONFIG_CARDBUS #ifdef CONFIG_CARDBUS
cb_release_cis_mem(s);
cb_free(s); cb_free(s);
#endif #endif
s->functions = 0; s->functions = 0;
......
...@@ -196,7 +196,6 @@ typedef struct socket_info_t { ...@@ -196,7 +196,6 @@ typedef struct socket_info_t {
int cb_alloc(socket_info_t *s); int cb_alloc(socket_info_t *s);
void cb_free(socket_info_t *s); void cb_free(socket_info_t *s);
int read_cb_mem(socket_info_t *s, int space, u_int addr, u_int len, void *ptr); int read_cb_mem(socket_info_t *s, int space, u_int addr, u_int len, void *ptr);
void cb_release_cis_mem(socket_info_t *s);
/* In cistpl.c */ /* In cistpl.c */
int read_cis_mem(socket_info_t *s, int attr, int read_cis_mem(socket_info_t *s, int attr,
......
...@@ -745,9 +745,6 @@ static int adjust_memory(adjust_t *adj) ...@@ -745,9 +745,6 @@ static int adjust_memory(adjust_t *adj)
if (ret == CS_SUCCESS) { if (ret == CS_SUCCESS) {
for (i = 0; i < sockets; i++) { for (i = 0; i < sockets; i++) {
release_cis_mem(socket_table[i]); release_cis_mem(socket_table[i]);
#ifdef CONFIG_CARDBUS
cb_release_cis_mem(socket_table[i]);
#endif
} }
} }
break; break;
......
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