From: Andrew Morton Date: Thu, 17 Nov 2005 05:29:26 +0000 (-0800) Subject: [PATCH] pcmcia: validate_mem fix X-Git-Tag: v2.6.16-rc1~474^2~21^2~2^2~17 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2cff944720332535a24b7eae16cff32055a43048;p=linux-2.6 [PATCH] pcmcia: validate_mem fix Also return a value if CONFIG_PCMCIA_PROBE is not set. Signed-off-by: Andrew Morton Signed-off-by: Dominik Brodowski --- diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c index ebfcab5df9..6b18092205 100644 --- a/drivers/pcmcia/rsrc_nonstatic.c +++ b/drivers/pcmcia/rsrc_nonstatic.c @@ -467,15 +467,19 @@ static int validate_mem(struct pcmcia_socket *s, unsigned int probe_mask) #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 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) { 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 */