patch-2.2.19 linux/drivers/s390/block/dasd_diag.c

Next file: linux/drivers/s390/block/dasd_eckd.c
Previous file: linux/drivers/s390/block/dasd_9343_erp.h
Back to the patch index
Back to the overall index

diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.18/drivers/s390/block/dasd_diag.c linux/drivers/s390/block/dasd_diag.c
@@ -268,13 +268,14 @@
                          "Null device pointer passed to characteristics checker\n");
                 return -ENODEV;
         }
+        if ( device->private != NULL ) {
+                kfree(device->private);
+        }
+        device->private = kmalloc(sizeof(dasd_diag_private_t),GFP_KERNEL);
         if ( device->private == NULL ) {
-		device->private = kmalloc(sizeof(dasd_diag_private_t),GFP_KERNEL);
-		if ( device->private == NULL ) {
-			printk ( KERN_WARNING PRINTK_HEADER
-				 "memory allocation failed for private data\n");
-			return -ENOMEM;
-		}
+                printk ( KERN_WARNING PRINTK_HEADER
+                         "memory allocation failed for private data\n");
+                return -ENOMEM;
         }
         private = (dasd_diag_private_t *)device->private;
         rdc_data = (void *)&(private->rdc_data);
@@ -318,7 +319,7 @@
                 if (rc > 4) {
                         continue;
 		}
-                cqr = ccw_alloc_request (dasd_diag_discipline.name, 2,0);
+                cqr = dasd_alloc_request (dasd_diag_discipline.name, 2,0);
                 if ( cqr == NULL ) {
                         printk ( KERN_WARNING PRINTK_HEADER
                                  "No memory to allocate initialization request\n");
@@ -501,7 +502,7 @@
 			}
 		} else {
 			PRINT_WARN ("Cannot fulfill request smaller than block\n");
-			ccw_free_request (rw_cp);
+			dasd_free_request (rw_cp);
 			return NULL;
 		}
 	}
@@ -532,6 +533,7 @@
 dasd_discipline_t dasd_diag_discipline = {
 	name :                          "DIAG",
 	ebcname :                       "DIAG",
+	max_blocks:			PAGE_SIZE/sizeof(diag_bio_t),
         check_characteristics:          dasd_diag_check_characteristics,
         do_analysis:                    dasd_diag_do_analysis,          
         fill_geometry:                  dasd_diag_fill_geometry,

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