[S390] tape: Use ccw_dev_id to build cdev_id.

To construct the integer containing the information from the bus_id,
it is easier to use the data from ccw_dev_id than to parse the bus_id.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by Cornelia Huck and committed by Martin Schwidefsky f455adcf f16f5843

+5 -26
+5 -26
drivers/s390/char/tape_core.c
··· 76 76 [TO_KEKL_QUERY] = "KLQ",[TO_RDC] = "RDC", 77 77 }; 78 78 79 - static int 80 - busid_to_int(char *bus_id) 79 + static int devid_to_int(struct ccw_dev_id *dev_id) 81 80 { 82 - int dec; 83 - int d; 84 - char * s; 85 - 86 - for(s = bus_id, d = 0; *s != '\0' && *s != '.'; s++) 87 - d = (d * 10) + (*s - '0'); 88 - dec = d; 89 - for(s++, d = 0; *s != '\0' && *s != '.'; s++) 90 - d = (d * 10) + (*s - '0'); 91 - dec = (dec << 8) + d; 92 - 93 - for(s++; *s != '\0'; s++) { 94 - if (*s >= '0' && *s <= '9') { 95 - d = *s - '0'; 96 - } else if (*s >= 'a' && *s <= 'f') { 97 - d = *s - 'a' + 10; 98 - } else { 99 - d = *s - 'A' + 10; 100 - } 101 - dec = (dec << 4) + d; 102 - } 103 - 104 - return dec; 81 + return dev_id->devno + (dev_id->ssid << 16); 105 82 } 106 83 107 84 /* ··· 528 551 { 529 552 struct tape_device *device; 530 553 int ret; 554 + struct ccw_dev_id dev_id; 531 555 532 556 device = tape_alloc_device(); 533 557 if (IS_ERR(device)) ··· 543 565 cdev->dev.driver_data = device; 544 566 cdev->handler = __tape_do_irq; 545 567 device->cdev = cdev; 546 - device->cdev_id = busid_to_int(cdev->dev.bus_id); 568 + ccw_device_get_id(cdev, &dev_id); 569 + device->cdev_id = devid_to_int(&dev_id); 547 570 PRINT_INFO("tape device %s found\n", cdev->dev.bus_id); 548 571 return ret; 549 572 }