[S390] cio: Get rid of _ccw_device_get_device_number().
authorCornelia Huck <cornelia.huck@de.ibm.com>
Thu, 10 May 2007 13:45:42 +0000 (15:45 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 10 May 2007 13:45:51 +0000 (15:45 +0200)
The function shouldn't have existed in the first place (not MSS-aware).
Introduce a new function ccw_device_get_id() that extracts the
ccw_dev_id structure of a ccw device and convert all users of
_ccw_device_get_device_number to ccw_device_get_id.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/block/dasd_diag.c
drivers/s390/block/dasd_ioctl.c
drivers/s390/char/raw3270.c
drivers/s390/cio/device_ops.c
include/asm-s390/ccwdev.h

index e810e4a44ed4ea2105b9c6169487e21d78d20e43..eccac1c3b71bb86ef535300a21c4311ebce343a9 100644 (file)
@@ -50,6 +50,7 @@ struct dasd_diag_private {
        struct dasd_diag_rw_io iob;
        struct dasd_diag_init_io iib;
        blocknum_t pt_block;
+       struct ccw_dev_id dev_id;
 };
 
 struct dasd_diag_req {
@@ -102,7 +103,7 @@ mdsk_init_io(struct dasd_device *device, unsigned int blocksize,
        iib = &private->iib;
        memset(iib, 0, sizeof (struct dasd_diag_init_io));
 
-       iib->dev_nr = _ccw_device_get_device_number(device->cdev);
+       iib->dev_nr = private->dev_id.devno;
        iib->block_size = blocksize;
        iib->offset = offset;
        iib->flaga = DASD_DIAG_FLAGA_DEFAULT;
@@ -127,7 +128,7 @@ mdsk_term_io(struct dasd_device * device)
        private = (struct dasd_diag_private *) device->private;
        iib = &private->iib;
        memset(iib, 0, sizeof (struct dasd_diag_init_io));
-       iib->dev_nr = _ccw_device_get_device_number(device->cdev);
+       iib->dev_nr = private->dev_id.devno;
        rc = dia250(iib, TERM_BIO);
        return rc;
 }
@@ -166,7 +167,7 @@ dasd_start_diag(struct dasd_ccw_req * cqr)
        private = (struct dasd_diag_private *) device->private;
        dreq = (struct dasd_diag_req *) cqr->data;
 
-       private->iob.dev_nr = _ccw_device_get_device_number(device->cdev);
+       private->iob.dev_nr = private->dev_id.devno;
        private->iob.key = 0;
        private->iob.flags = DASD_DIAG_RWFLAG_ASYNC;
        private->iob.block_count = dreq->block_count;
@@ -323,11 +324,12 @@ dasd_diag_check_device(struct dasd_device *device)
                                "memory allocation failed for private data");
                        return -ENOMEM;
                }
+               ccw_device_get_id(device->cdev, &private->dev_id);
                device->private = (void *) private;
        }
        /* Read Device Characteristics */
        rdc_data = (void *) &(private->rdc_data);
-       rdc_data->dev_nr = _ccw_device_get_device_number(device->cdev);
+       rdc_data->dev_nr = private->dev_id.devno;
        rdc_data->rdc_len = sizeof (struct dasd_diag_characteristics);
 
        rc = diag210((struct diag210 *) rdc_data);
index 758cfb54286570b2333998adcf2180bf20ee32c5..672eb0a3dd0bd4e5e48a71ce33456ee0ce668dc6 100644 (file)
@@ -255,6 +255,7 @@ dasd_ioctl_information(struct dasd_device *device,
        unsigned long flags;
        int rc;
        struct ccw_device *cdev;
+       struct ccw_dev_id dev_id;
 
        if (!device->discipline->fill_info)
                return -EINVAL;
@@ -270,8 +271,9 @@ dasd_ioctl_information(struct dasd_device *device,
        }
 
        cdev = device->cdev;
+       ccw_device_get_id(cdev, &dev_id);
 
-       dasd_info->devno = _ccw_device_get_device_number(device->cdev);
+       dasd_info->devno = dev_id.devno;
        dasd_info->schid = _ccw_device_get_subchannel_number(device->cdev);
        dasd_info->cu_type = cdev->id.cu_type;
        dasd_info->cu_model = cdev->id.cu_model;
index 8facd14adb7c168ab2d5c6137fd6eee63ffebbec..f6ef90ee3e7d83d06090ff594818d2f40fdd6c85 100644 (file)
@@ -589,9 +589,10 @@ static int
 __raw3270_size_device_vm(struct raw3270 *rp)
 {
        int rc, model;
+       struct ccw_dev_id dev_id;
 
-       raw3270_init_diag210.vrdcdvno = 
-               _ccw_device_get_device_number(rp->cdev);
+       ccw_device_get_id(rp->cdev, &dev_id);
+       raw3270_init_diag210.vrdcdvno = dev_id.devno;
        raw3270_init_diag210.vrdclen = sizeof(struct diag210);
        rc = diag210(&raw3270_init_diag210);
        if (rc)
index 16f59fcb66b13938480a497f4d2deeda2d9fa669..a5d263fb55ae1722ff0aced679d55df0978e7546 100644 (file)
@@ -616,6 +616,17 @@ ccw_device_get_chp_desc(struct ccw_device *cdev, int chp_no)
        return chp_get_chp_desc(chpid);
 }
 
+/**
+ * ccw_device_get_id - obtain a ccw device id
+ * @cdev: device to obtain the id for
+ * @dev_id: where to fill in the values
+ */
+void ccw_device_get_id(struct ccw_device *cdev, struct ccw_dev_id *dev_id)
+{
+       *dev_id = cdev->private->dev_id;
+}
+EXPORT_SYMBOL(ccw_device_get_id);
+
 // FIXME: these have to go:
 
 int
index 6795ecefd15b353c3c93414856a770d5e350416a..4c2e1710f15724ad7d170adb25723683245a30e1 100644 (file)
@@ -16,6 +16,7 @@
 /* structs from asm/cio.h */
 struct irb;
 struct ccw1;
+struct ccw_dev_id;
 
 /* simplified initializers for struct ccw_device:
  * CCW_DEVICE and CCW_DEVICE_DEVTYPE initialize one
@@ -175,6 +176,7 @@ extern int ccw_device_set_offline(struct ccw_device *cdev);
 
 extern struct ciw *ccw_device_get_ciw(struct ccw_device *, __u32 cmd);
 extern __u8 ccw_device_get_path_mask(struct ccw_device *);
+extern void ccw_device_get_id(struct ccw_device *, struct ccw_dev_id *);
 
 #define get_ccwdev_lock(x) (x)->ccwlock
 
@@ -184,7 +186,6 @@ extern __u8 ccw_device_get_path_mask(struct ccw_device *);
 extern struct ccw_device *ccw_device_probe_console(void);
 
 // FIXME: these have to go
-extern int _ccw_device_get_device_number(struct ccw_device *);
 extern int _ccw_device_get_subchannel_number(struct ccw_device *);
 
 extern void *ccw_device_get_chp_desc(struct ccw_device *, int);