diff options
Diffstat (limited to 'drivers/s390/block/dasd_fba.c')
-rw-r--r-- | drivers/s390/block/dasd_fba.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c index 8912358daa2f..597c6ffdb9f2 100644 --- a/drivers/s390/block/dasd_fba.c +++ b/drivers/s390/block/dasd_fba.c | |||
@@ -122,20 +122,20 @@ dasd_fba_check_characteristics(struct dasd_device *device) | |||
122 | struct dasd_block *block; | 122 | struct dasd_block *block; |
123 | struct dasd_fba_private *private; | 123 | struct dasd_fba_private *private; |
124 | struct ccw_device *cdev = device->cdev; | 124 | struct ccw_device *cdev = device->cdev; |
125 | void *rdc_data; | ||
126 | int rc; | 125 | int rc; |
127 | 126 | ||
128 | private = (struct dasd_fba_private *) device->private; | 127 | private = (struct dasd_fba_private *) device->private; |
129 | if (private == NULL) { | 128 | if (!private) { |
130 | private = kzalloc(sizeof(struct dasd_fba_private), | 129 | private = kzalloc(sizeof(*private), GFP_KERNEL | GFP_DMA); |
131 | GFP_KERNEL | GFP_DMA); | 130 | if (!private) { |
132 | if (private == NULL) { | ||
133 | dev_warn(&device->cdev->dev, | 131 | dev_warn(&device->cdev->dev, |
134 | "Allocating memory for private DASD " | 132 | "Allocating memory for private DASD " |
135 | "data failed\n"); | 133 | "data failed\n"); |
136 | return -ENOMEM; | 134 | return -ENOMEM; |
137 | } | 135 | } |
138 | device->private = (void *) private; | 136 | device->private = (void *) private; |
137 | } else { | ||
138 | memset(private, 0, sizeof(*private)); | ||
139 | } | 139 | } |
140 | block = dasd_alloc_block(); | 140 | block = dasd_alloc_block(); |
141 | if (IS_ERR(block)) { | 141 | if (IS_ERR(block)) { |
@@ -150,8 +150,8 @@ dasd_fba_check_characteristics(struct dasd_device *device) | |||
150 | block->base = device; | 150 | block->base = device; |
151 | 151 | ||
152 | /* Read Device Characteristics */ | 152 | /* Read Device Characteristics */ |
153 | rdc_data = (void *) &(private->rdc_data); | 153 | rc = dasd_generic_read_dev_chars(device, "FBA ", &private->rdc_data, |
154 | rc = dasd_generic_read_dev_chars(device, "FBA ", &rdc_data, 32); | 154 | 32); |
155 | if (rc) { | 155 | if (rc) { |
156 | DBF_EVENT(DBF_WARNING, "Read device characteristics returned " | 156 | DBF_EVENT(DBF_WARNING, "Read device characteristics returned " |
157 | "error %d for device: %s", | 157 | "error %d for device: %s", |
@@ -604,8 +604,14 @@ static struct dasd_discipline dasd_fba_discipline = { | |||
604 | static int __init | 604 | static int __init |
605 | dasd_fba_init(void) | 605 | dasd_fba_init(void) |
606 | { | 606 | { |
607 | int ret; | ||
608 | |||
607 | ASCEBC(dasd_fba_discipline.ebcname, 4); | 609 | ASCEBC(dasd_fba_discipline.ebcname, 4); |
608 | return ccw_driver_register(&dasd_fba_driver); | 610 | ret = ccw_driver_register(&dasd_fba_driver); |
611 | if (!ret) | ||
612 | wait_for_device_probe(); | ||
613 | |||
614 | return ret; | ||
609 | } | 615 | } |
610 | 616 | ||
611 | static void __exit | 617 | static void __exit |