diff options
Diffstat (limited to 'drivers/s390/block/dasd_devmap.c')
-rw-r--r-- | drivers/s390/block/dasd_devmap.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c index d774e79476fe..cd3335c1c307 100644 --- a/drivers/s390/block/dasd_devmap.c +++ b/drivers/s390/block/dasd_devmap.c | |||
@@ -913,7 +913,8 @@ dasd_vendor_show(struct device *dev, struct device_attribute *attr, char *buf) | |||
913 | static DEVICE_ATTR(vendor, 0444, dasd_vendor_show, NULL); | 913 | static DEVICE_ATTR(vendor, 0444, dasd_vendor_show, NULL); |
914 | 914 | ||
915 | #define UID_STRLEN ( /* vendor */ 3 + 1 + /* serial */ 14 + 1 +\ | 915 | #define UID_STRLEN ( /* vendor */ 3 + 1 + /* serial */ 14 + 1 +\ |
916 | /* SSID */ 4 + 1 + /* unit addr */ 2 + 1) | 916 | /* SSID */ 4 + 1 + /* unit addr */ 2 + 1 +\ |
917 | /* vduit */ 32 + 1) | ||
917 | 918 | ||
918 | static ssize_t | 919 | static ssize_t |
919 | dasd_uid_show(struct device *dev, struct device_attribute *attr, char *buf) | 920 | dasd_uid_show(struct device *dev, struct device_attribute *attr, char *buf) |
@@ -945,8 +946,17 @@ dasd_uid_show(struct device *dev, struct device_attribute *attr, char *buf) | |||
945 | sprintf(ua_string, "%02x", uid->real_unit_addr); | 946 | sprintf(ua_string, "%02x", uid->real_unit_addr); |
946 | break; | 947 | break; |
947 | } | 948 | } |
948 | snprintf(uid_string, sizeof(uid_string), "%s.%s.%04x.%s", | 949 | if (strlen(uid->vduit) > 0) |
949 | uid->vendor, uid->serial, uid->ssid, ua_string); | 950 | snprintf(uid_string, sizeof(uid_string), |
951 | "%s.%s.%04x.%s.%s", | ||
952 | uid->vendor, uid->serial, | ||
953 | uid->ssid, ua_string, | ||
954 | uid->vduit); | ||
955 | else | ||
956 | snprintf(uid_string, sizeof(uid_string), | ||
957 | "%s.%s.%04x.%s", | ||
958 | uid->vendor, uid->serial, | ||
959 | uid->ssid, ua_string); | ||
950 | spin_unlock(&dasd_devmap_lock); | 960 | spin_unlock(&dasd_devmap_lock); |
951 | return snprintf(buf, PAGE_SIZE, "%s\n", uid_string); | 961 | return snprintf(buf, PAGE_SIZE, "%s\n", uid_string); |
952 | } | 962 | } |