patch-2.4.20 linux-2.4.20/drivers/pcmcia/bulkmem.c

Next file: linux-2.4.20/drivers/pcmcia/cardbus.c
Previous file: linux-2.4.20/drivers/pcmcia/au1000_pb1x00.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.19/drivers/pcmcia/bulkmem.c linux-2.4.20/drivers/pcmcia/bulkmem.c
@@ -211,7 +211,7 @@
     retry_erase((erase_busy_t *)arg, MTD_REQ_TIMEOUT);
 }
 
-static int setup_erase_request(client_handle_t handle, eraseq_entry_t *erase)
+static void setup_erase_request(client_handle_t handle, eraseq_entry_t *erase)
 {
     erase_busy_t *busy;
     region_info_t *info;
@@ -229,8 +229,10 @@
 	else {
 	    erase->State = 1;
 	    busy = kmalloc(sizeof(erase_busy_t), GFP_KERNEL);
-	    if (!busy)
-		return CS_GENERAL_FAILURE;
+	    if (!busy) {
+		erase->State = ERASE_FAILED;
+		return;
+	    }
 	    busy->erase = erase;
 	    busy->client = handle;
 	    init_timer(&busy->timeout);
@@ -240,7 +242,6 @@
 	    retry_erase(busy, 0);
 	}
     }
-    return CS_SUCCESS;
 } /* setup_erase_request */
 
 /*======================================================================
@@ -325,7 +326,7 @@
     
 ======================================================================*/
 
-static int setup_regions(client_handle_t handle, int attr,
+static void setup_regions(client_handle_t handle, int attr,
 			  memory_handle_t *list)
 {
     int i, code, has_jedec, has_geo;
@@ -340,7 +341,7 @@
 
     code = (attr) ? CISTPL_DEVICE_A : CISTPL_DEVICE;
     if (read_tuple(handle, code, &device) != CS_SUCCESS)
-	return CS_GENERAL_FAILURE;
+	return;
     code = (attr) ? CISTPL_JEDEC_A : CISTPL_JEDEC_C;
     has_jedec = (read_tuple(handle, code, &jedec) == CS_SUCCESS);
     if (has_jedec && (device.ndev != jedec.nid)) {
@@ -363,8 +364,10 @@
 	if ((device.dev[i].type != CISTPL_DTYPE_NULL) &&
 	    (device.dev[i].size != 0)) {
 	    r = kmalloc(sizeof(*r), GFP_KERNEL);
-	    if (!r)
-		return CS_GENERAL_FAILURE;
+	    if (!r) {
+		printk(KERN_NOTICE "cs: setup_regions: kmalloc failed!\n");
+		return;
+	    }
 	    r->region_magic = REGION_MAGIC;
 	    r->state = 0;
 	    r->dev_info[0] = '\0';
@@ -389,7 +392,6 @@
 	}
 	offset += device.dev[i].size;
     }
-    return CS_SUCCESS;
 } /* setup_regions */
 
 /*======================================================================
@@ -423,10 +425,8 @@
     
     if ((handle->Attributes & INFO_MASTER_CLIENT) &&
 	(!(s->state & SOCKET_REGION_INFO))) {
-	if (setup_regions(handle, 0, &s->c_region) != CS_SUCCESS)
-	    return CS_GENERAL_FAILURE;
-	if (setup_regions(handle, 1, &s->a_region) != CS_SUCCESS)
-	    return CS_GENERAL_FAILURE;
+	setup_regions(handle, 0, &s->c_region);
+	setup_regions(handle, 1, &s->a_region);
 	s->state |= SOCKET_REGION_INFO;
     }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)