aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block/dasd_proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/block/dasd_proc.c')
-rw-r--r--drivers/s390/block/dasd_proc.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c
index ac7e8ef504cb..28a86f070048 100644
--- a/drivers/s390/block/dasd_proc.c
+++ b/drivers/s390/block/dasd_proc.c
@@ -54,11 +54,16 @@ static int
54dasd_devices_show(struct seq_file *m, void *v) 54dasd_devices_show(struct seq_file *m, void *v)
55{ 55{
56 struct dasd_device *device; 56 struct dasd_device *device;
57 struct dasd_block *block;
57 char *substr; 58 char *substr;
58 59
59 device = dasd_device_from_devindex((unsigned long) v - 1); 60 device = dasd_device_from_devindex((unsigned long) v - 1);
60 if (IS_ERR(device)) 61 if (IS_ERR(device))
61 return 0; 62 return 0;
63 if (device->block)
64 block = device->block;
65 else
66 return 0;
62 /* Print device number. */ 67 /* Print device number. */
63 seq_printf(m, "%s", device->cdev->dev.bus_id); 68 seq_printf(m, "%s", device->cdev->dev.bus_id);
64 /* Print discipline string. */ 69 /* Print discipline string. */
@@ -67,14 +72,14 @@ dasd_devices_show(struct seq_file *m, void *v)
67 else 72 else
68 seq_printf(m, "(none)"); 73 seq_printf(m, "(none)");
69 /* Print kdev. */ 74 /* Print kdev. */
70 if (device->gdp) 75 if (block->gdp)
71 seq_printf(m, " at (%3d:%6d)", 76 seq_printf(m, " at (%3d:%6d)",
72 device->gdp->major, device->gdp->first_minor); 77 block->gdp->major, block->gdp->first_minor);
73 else 78 else
74 seq_printf(m, " at (???:??????)"); 79 seq_printf(m, " at (???:??????)");
75 /* Print device name. */ 80 /* Print device name. */
76 if (device->gdp) 81 if (block->gdp)
77 seq_printf(m, " is %-8s", device->gdp->disk_name); 82 seq_printf(m, " is %-8s", block->gdp->disk_name);
78 else 83 else
79 seq_printf(m, " is ????????"); 84 seq_printf(m, " is ????????");
80 /* Print devices features. */ 85 /* Print devices features. */
@@ -100,14 +105,14 @@ dasd_devices_show(struct seq_file *m, void *v)
100 case DASD_STATE_READY: 105 case DASD_STATE_READY:
101 case DASD_STATE_ONLINE: 106 case DASD_STATE_ONLINE:
102 seq_printf(m, "active "); 107 seq_printf(m, "active ");
103 if (dasd_check_blocksize(device->bp_block)) 108 if (dasd_check_blocksize(block->bp_block))
104 seq_printf(m, "n/f "); 109 seq_printf(m, "n/f ");
105 else 110 else
106 seq_printf(m, 111 seq_printf(m,
107 "at blocksize: %d, %ld blocks, %ld MB", 112 "at blocksize: %d, %ld blocks, %ld MB",
108 device->bp_block, device->blocks, 113 block->bp_block, block->blocks,
109 ((device->bp_block >> 9) * 114 ((block->bp_block >> 9) *
110 device->blocks) >> 11); 115 block->blocks) >> 11);
111 break; 116 break;
112 default: 117 default:
113 seq_printf(m, "no stat"); 118 seq_printf(m, "no stat");
@@ -137,7 +142,7 @@ static void dasd_devices_stop(struct seq_file *m, void *v)
137{ 142{
138} 143}
139 144
140static struct seq_operations dasd_devices_seq_ops = { 145static const struct seq_operations dasd_devices_seq_ops = {
141 .start = dasd_devices_start, 146 .start = dasd_devices_start,
142 .next = dasd_devices_next, 147 .next = dasd_devices_next,
143 .stop = dasd_devices_stop, 148 .stop = dasd_devices_stop,