[PATCH] pcmcia: validate_mem fix

Also return a value if CONFIG_PCMCIA_PROBE is not set.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This commit is contained in:
Andrew Morton 2005-11-16 21:29:26 -08:00 committed by Dominik Brodowski
parent de75914ee1
commit 2cff944720
1 changed files with 6 additions and 2 deletions

View File

@ -467,15 +467,19 @@ static int validate_mem(struct pcmcia_socket *s, unsigned int probe_mask)
#else /* CONFIG_PCMCIA_PROBE */ #else /* CONFIG_PCMCIA_PROBE */
static void validate_mem(struct pcmcia_socket *s, unsigned int probe_mask) static int validate_mem(struct pcmcia_socket *s, unsigned int probe_mask)
{ {
struct resource_map *m, mm; struct resource_map *m, mm;
struct socket_data *s_data = s->resource_data; struct socket_data *s_data = s->resource_data;
unsigned long ok = 0;
for (m = s_data->mem_db.next; m != &s_data->mem_db; m = mm.next) { for (m = s_data->mem_db.next; m != &s_data->mem_db; m = mm.next) {
mm = *m; mm = *m;
do_mem_probe(mm.base, mm.num, s); ok += do_mem_probe(mm.base, mm.num, s);
} }
if (ok > 0)
return 0;
return -ENODEV;
} }
#endif /* CONFIG_PCMCIA_PROBE */ #endif /* CONFIG_PCMCIA_PROBE */