diff options
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/drbd/drbd_actlog.c | 2 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_bitmap.c | 37 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 6 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_worker.c | 7 | ||||
-rw-r--r-- | drivers/block/hd.c | 2 | ||||
-rw-r--r-- | drivers/block/pktcdvd.c | 2 | ||||
-rw-r--r-- | drivers/block/xen-blkback/xenbus.c | 2 | ||||
-rw-r--r-- | drivers/block/xsysace.c | 98 |
8 files changed, 50 insertions, 106 deletions
diff --git a/drivers/block/drbd/drbd_actlog.c b/drivers/block/drbd/drbd_actlog.c index 09ef9a878ef..cf0e63dd97d 100644 --- a/drivers/block/drbd/drbd_actlog.c +++ b/drivers/block/drbd/drbd_actlog.c | |||
@@ -79,7 +79,7 @@ static int _drbd_md_sync_page_io(struct drbd_conf *mdev, | |||
79 | md_io.error = 0; | 79 | md_io.error = 0; |
80 | 80 | ||
81 | if ((rw & WRITE) && !test_bit(MD_NO_FUA, &mdev->flags)) | 81 | if ((rw & WRITE) && !test_bit(MD_NO_FUA, &mdev->flags)) |
82 | rw |= REQ_FUA; | 82 | rw |= REQ_FUA | REQ_FLUSH; |
83 | rw |= REQ_SYNC; | 83 | rw |= REQ_SYNC; |
84 | 84 | ||
85 | bio = bio_alloc(GFP_NOIO, 1); | 85 | bio = bio_alloc(GFP_NOIO, 1); |
diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index f440a02dfdb..7b976296b56 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c | |||
@@ -112,9 +112,6 @@ struct drbd_bitmap { | |||
112 | struct task_struct *bm_task; | 112 | struct task_struct *bm_task; |
113 | }; | 113 | }; |
114 | 114 | ||
115 | static int __bm_change_bits_to(struct drbd_conf *mdev, const unsigned long s, | ||
116 | unsigned long e, int val, const enum km_type km); | ||
117 | |||
118 | #define bm_print_lock_info(m) __bm_print_lock_info(m, __func__) | 115 | #define bm_print_lock_info(m) __bm_print_lock_info(m, __func__) |
119 | static void __bm_print_lock_info(struct drbd_conf *mdev, const char *func) | 116 | static void __bm_print_lock_info(struct drbd_conf *mdev, const char *func) |
120 | { | 117 | { |
@@ -994,6 +991,9 @@ static void bm_page_io_async(struct bm_aio_ctx *ctx, int page_nr, int rw) __must | |||
994 | bio_endio(bio, -EIO); | 991 | bio_endio(bio, -EIO); |
995 | } else { | 992 | } else { |
996 | submit_bio(rw, bio); | 993 | submit_bio(rw, bio); |
994 | /* this should not count as user activity and cause the | ||
995 | * resync to throttle -- see drbd_rs_should_slow_down(). */ | ||
996 | atomic_add(len >> 9, &mdev->rs_sect_ev); | ||
997 | } | 997 | } |
998 | } | 998 | } |
999 | 999 | ||
@@ -1256,7 +1256,7 @@ unsigned long _drbd_bm_find_next_zero(struct drbd_conf *mdev, unsigned long bm_f | |||
1256 | * expected to be called for only a few bits (e - s about BITS_PER_LONG). | 1256 | * expected to be called for only a few bits (e - s about BITS_PER_LONG). |
1257 | * Must hold bitmap lock already. */ | 1257 | * Must hold bitmap lock already. */ |
1258 | static int __bm_change_bits_to(struct drbd_conf *mdev, const unsigned long s, | 1258 | static int __bm_change_bits_to(struct drbd_conf *mdev, const unsigned long s, |
1259 | unsigned long e, int val, const enum km_type km) | 1259 | unsigned long e, int val) |
1260 | { | 1260 | { |
1261 | struct drbd_bitmap *b = mdev->bitmap; | 1261 | struct drbd_bitmap *b = mdev->bitmap; |
1262 | unsigned long *p_addr = NULL; | 1262 | unsigned long *p_addr = NULL; |
@@ -1274,14 +1274,14 @@ static int __bm_change_bits_to(struct drbd_conf *mdev, const unsigned long s, | |||
1274 | unsigned int page_nr = bm_bit_to_page_idx(b, bitnr); | 1274 | unsigned int page_nr = bm_bit_to_page_idx(b, bitnr); |
1275 | if (page_nr != last_page_nr) { | 1275 | if (page_nr != last_page_nr) { |
1276 | if (p_addr) | 1276 | if (p_addr) |
1277 | __bm_unmap(p_addr, km); | 1277 | __bm_unmap(p_addr, KM_IRQ1); |
1278 | if (c < 0) | 1278 | if (c < 0) |
1279 | bm_set_page_lazy_writeout(b->bm_pages[last_page_nr]); | 1279 | bm_set_page_lazy_writeout(b->bm_pages[last_page_nr]); |
1280 | else if (c > 0) | 1280 | else if (c > 0) |
1281 | bm_set_page_need_writeout(b->bm_pages[last_page_nr]); | 1281 | bm_set_page_need_writeout(b->bm_pages[last_page_nr]); |
1282 | changed_total += c; | 1282 | changed_total += c; |
1283 | c = 0; | 1283 | c = 0; |
1284 | p_addr = __bm_map_pidx(b, page_nr, km); | 1284 | p_addr = __bm_map_pidx(b, page_nr, KM_IRQ1); |
1285 | last_page_nr = page_nr; | 1285 | last_page_nr = page_nr; |
1286 | } | 1286 | } |
1287 | if (val) | 1287 | if (val) |
@@ -1290,7 +1290,7 @@ static int __bm_change_bits_to(struct drbd_conf *mdev, const unsigned long s, | |||
1290 | c -= (0 != __test_and_clear_bit_le(bitnr & BITS_PER_PAGE_MASK, p_addr)); | 1290 | c -= (0 != __test_and_clear_bit_le(bitnr & BITS_PER_PAGE_MASK, p_addr)); |
1291 | } | 1291 | } |
1292 | if (p_addr) | 1292 | if (p_addr) |
1293 | __bm_unmap(p_addr, km); | 1293 | __bm_unmap(p_addr, KM_IRQ1); |
1294 | if (c < 0) | 1294 | if (c < 0) |
1295 | bm_set_page_lazy_writeout(b->bm_pages[last_page_nr]); | 1295 | bm_set_page_lazy_writeout(b->bm_pages[last_page_nr]); |
1296 | else if (c > 0) | 1296 | else if (c > 0) |
@@ -1318,7 +1318,7 @@ static int bm_change_bits_to(struct drbd_conf *mdev, const unsigned long s, | |||
1318 | if ((val ? BM_DONT_SET : BM_DONT_CLEAR) & b->bm_flags) | 1318 | if ((val ? BM_DONT_SET : BM_DONT_CLEAR) & b->bm_flags) |
1319 | bm_print_lock_info(mdev); | 1319 | bm_print_lock_info(mdev); |
1320 | 1320 | ||
1321 | c = __bm_change_bits_to(mdev, s, e, val, KM_IRQ1); | 1321 | c = __bm_change_bits_to(mdev, s, e, val); |
1322 | 1322 | ||
1323 | spin_unlock_irqrestore(&b->bm_lock, flags); | 1323 | spin_unlock_irqrestore(&b->bm_lock, flags); |
1324 | return c; | 1324 | return c; |
@@ -1343,16 +1343,17 @@ static inline void bm_set_full_words_within_one_page(struct drbd_bitmap *b, | |||
1343 | { | 1343 | { |
1344 | int i; | 1344 | int i; |
1345 | int bits; | 1345 | int bits; |
1346 | unsigned long *paddr = kmap_atomic(b->bm_pages[page_nr], KM_USER0); | 1346 | unsigned long *paddr = kmap_atomic(b->bm_pages[page_nr], KM_IRQ1); |
1347 | for (i = first_word; i < last_word; i++) { | 1347 | for (i = first_word; i < last_word; i++) { |
1348 | bits = hweight_long(paddr[i]); | 1348 | bits = hweight_long(paddr[i]); |
1349 | paddr[i] = ~0UL; | 1349 | paddr[i] = ~0UL; |
1350 | b->bm_set += BITS_PER_LONG - bits; | 1350 | b->bm_set += BITS_PER_LONG - bits; |
1351 | } | 1351 | } |
1352 | kunmap_atomic(paddr, KM_USER0); | 1352 | kunmap_atomic(paddr, KM_IRQ1); |
1353 | } | 1353 | } |
1354 | 1354 | ||
1355 | /* Same thing as drbd_bm_set_bits, but without taking the spin_lock_irqsave. | 1355 | /* Same thing as drbd_bm_set_bits, |
1356 | * but more efficient for a large bit range. | ||
1356 | * You must first drbd_bm_lock(). | 1357 | * You must first drbd_bm_lock(). |
1357 | * Can be called to set the whole bitmap in one go. | 1358 | * Can be called to set the whole bitmap in one go. |
1358 | * Sets bits from s to e _inclusive_. */ | 1359 | * Sets bits from s to e _inclusive_. */ |
@@ -1366,6 +1367,7 @@ void _drbd_bm_set_bits(struct drbd_conf *mdev, const unsigned long s, const unsi | |||
1366 | * Do not use memset, because we must account for changes, | 1367 | * Do not use memset, because we must account for changes, |
1367 | * so we need to loop over the words with hweight() anyways. | 1368 | * so we need to loop over the words with hweight() anyways. |
1368 | */ | 1369 | */ |
1370 | struct drbd_bitmap *b = mdev->bitmap; | ||
1369 | unsigned long sl = ALIGN(s,BITS_PER_LONG); | 1371 | unsigned long sl = ALIGN(s,BITS_PER_LONG); |
1370 | unsigned long el = (e+1) & ~((unsigned long)BITS_PER_LONG-1); | 1372 | unsigned long el = (e+1) & ~((unsigned long)BITS_PER_LONG-1); |
1371 | int first_page; | 1373 | int first_page; |
@@ -1376,15 +1378,19 @@ void _drbd_bm_set_bits(struct drbd_conf *mdev, const unsigned long s, const unsi | |||
1376 | 1378 | ||
1377 | if (e - s <= 3*BITS_PER_LONG) { | 1379 | if (e - s <= 3*BITS_PER_LONG) { |
1378 | /* don't bother; el and sl may even be wrong. */ | 1380 | /* don't bother; el and sl may even be wrong. */ |
1379 | __bm_change_bits_to(mdev, s, e, 1, KM_USER0); | 1381 | spin_lock_irq(&b->bm_lock); |
1382 | __bm_change_bits_to(mdev, s, e, 1); | ||
1383 | spin_unlock_irq(&b->bm_lock); | ||
1380 | return; | 1384 | return; |
1381 | } | 1385 | } |
1382 | 1386 | ||
1383 | /* difference is large enough that we can trust sl and el */ | 1387 | /* difference is large enough that we can trust sl and el */ |
1384 | 1388 | ||
1389 | spin_lock_irq(&b->bm_lock); | ||
1390 | |||
1385 | /* bits filling the current long */ | 1391 | /* bits filling the current long */ |
1386 | if (sl) | 1392 | if (sl) |
1387 | __bm_change_bits_to(mdev, s, sl-1, 1, KM_USER0); | 1393 | __bm_change_bits_to(mdev, s, sl-1, 1); |
1388 | 1394 | ||
1389 | first_page = sl >> (3 + PAGE_SHIFT); | 1395 | first_page = sl >> (3 + PAGE_SHIFT); |
1390 | last_page = el >> (3 + PAGE_SHIFT); | 1396 | last_page = el >> (3 + PAGE_SHIFT); |
@@ -1397,8 +1403,10 @@ void _drbd_bm_set_bits(struct drbd_conf *mdev, const unsigned long s, const unsi | |||
1397 | /* first and full pages, unless first page == last page */ | 1403 | /* first and full pages, unless first page == last page */ |
1398 | for (page_nr = first_page; page_nr < last_page; page_nr++) { | 1404 | for (page_nr = first_page; page_nr < last_page; page_nr++) { |
1399 | bm_set_full_words_within_one_page(mdev->bitmap, page_nr, first_word, last_word); | 1405 | bm_set_full_words_within_one_page(mdev->bitmap, page_nr, first_word, last_word); |
1406 | spin_unlock_irq(&b->bm_lock); | ||
1400 | cond_resched(); | 1407 | cond_resched(); |
1401 | first_word = 0; | 1408 | first_word = 0; |
1409 | spin_lock_irq(&b->bm_lock); | ||
1402 | } | 1410 | } |
1403 | 1411 | ||
1404 | /* last page (respectively only page, for first page == last page) */ | 1412 | /* last page (respectively only page, for first page == last page) */ |
@@ -1411,7 +1419,8 @@ void _drbd_bm_set_bits(struct drbd_conf *mdev, const unsigned long s, const unsi | |||
1411 | * it would trigger an assert in __bm_change_bits_to() | 1419 | * it would trigger an assert in __bm_change_bits_to() |
1412 | */ | 1420 | */ |
1413 | if (el <= e) | 1421 | if (el <= e) |
1414 | __bm_change_bits_to(mdev, el, e, 1, KM_USER0); | 1422 | __bm_change_bits_to(mdev, el, e, 1); |
1423 | spin_unlock_irq(&b->bm_lock); | ||
1415 | } | 1424 | } |
1416 | 1425 | ||
1417 | /* returns bit state | 1426 | /* returns bit state |
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 25d32c5aa50..43beaca5317 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c | |||
@@ -4602,6 +4602,11 @@ int drbd_asender(struct drbd_thread *thi) | |||
4602 | dev_err(DEV, "meta connection shut down by peer.\n"); | 4602 | dev_err(DEV, "meta connection shut down by peer.\n"); |
4603 | goto reconnect; | 4603 | goto reconnect; |
4604 | } else if (rv == -EAGAIN) { | 4604 | } else if (rv == -EAGAIN) { |
4605 | /* If the data socket received something meanwhile, | ||
4606 | * that is good enough: peer is still alive. */ | ||
4607 | if (time_after(mdev->last_received, | ||
4608 | jiffies - mdev->meta.socket->sk->sk_rcvtimeo)) | ||
4609 | continue; | ||
4605 | if (ping_timeout_active) { | 4610 | if (ping_timeout_active) { |
4606 | dev_err(DEV, "PingAck did not arrive in time.\n"); | 4611 | dev_err(DEV, "PingAck did not arrive in time.\n"); |
4607 | goto reconnect; | 4612 | goto reconnect; |
@@ -4637,6 +4642,7 @@ int drbd_asender(struct drbd_thread *thi) | |||
4637 | goto reconnect; | 4642 | goto reconnect; |
4638 | } | 4643 | } |
4639 | if (received == expect) { | 4644 | if (received == expect) { |
4645 | mdev->last_received = jiffies; | ||
4640 | D_ASSERT(cmd != NULL); | 4646 | D_ASSERT(cmd != NULL); |
4641 | if (!cmd->process(mdev, h)) | 4647 | if (!cmd->process(mdev, h)) |
4642 | goto reconnect; | 4648 | goto reconnect; |
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index 4d76b06b6b2..4d3e6f6213b 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c | |||
@@ -536,12 +536,7 @@ static int w_make_resync_request(struct drbd_conf *mdev, | |||
536 | return 1; | 536 | return 1; |
537 | } | 537 | } |
538 | 538 | ||
539 | /* starting with drbd 8.3.8, we can handle multi-bio EEs, | 539 | max_bio_size = queue_max_hw_sectors(mdev->rq_queue) << 9; |
540 | * if it should be necessary */ | ||
541 | max_bio_size = | ||
542 | mdev->agreed_pro_version < 94 ? queue_max_hw_sectors(mdev->rq_queue) << 9 : | ||
543 | mdev->agreed_pro_version < 95 ? DRBD_MAX_SIZE_H80_PACKET : DRBD_MAX_BIO_SIZE; | ||
544 | |||
545 | number = drbd_rs_number_requests(mdev); | 540 | number = drbd_rs_number_requests(mdev); |
546 | if (number == 0) | 541 | if (number == 0) |
547 | goto requeue; | 542 | goto requeue; |
diff --git a/drivers/block/hd.c b/drivers/block/hd.c index 007c630904c..b52c9ca146f 100644 --- a/drivers/block/hd.c +++ b/drivers/block/hd.c | |||
@@ -155,7 +155,7 @@ else \ | |||
155 | 155 | ||
156 | #if (HD_DELAY > 0) | 156 | #if (HD_DELAY > 0) |
157 | 157 | ||
158 | #include <asm/i8253.h> | 158 | #include <linux/i8253.h> |
159 | 159 | ||
160 | unsigned long last_req; | 160 | unsigned long last_req; |
161 | 161 | ||
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 07a382eaf0a..e133f094ab0 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -1206,7 +1206,7 @@ static int pkt_start_recovery(struct packet_data *pkt) | |||
1206 | if (!sb) | 1206 | if (!sb) |
1207 | return 0; | 1207 | return 0; |
1208 | 1208 | ||
1209 | if (!sb->s_op || !sb->s_op->relocate_blocks) | 1209 | if (!sb->s_op->relocate_blocks) |
1210 | goto out; | 1210 | goto out; |
1211 | 1211 | ||
1212 | old_block = pkt->sector / (CD_FRAMESIZE >> 9); | 1212 | old_block = pkt->sector / (CD_FRAMESIZE >> 9); |
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c index 6cc0db1bf52..3f129b45451 100644 --- a/drivers/block/xen-blkback/xenbus.c +++ b/drivers/block/xen-blkback/xenbus.c | |||
@@ -684,7 +684,7 @@ again: | |||
684 | 684 | ||
685 | err = xenbus_switch_state(dev, XenbusStateConnected); | 685 | err = xenbus_switch_state(dev, XenbusStateConnected); |
686 | if (err) | 686 | if (err) |
687 | xenbus_dev_fatal(dev, err, "switching to Connected state", | 687 | xenbus_dev_fatal(dev, err, "%s: switching to Connected state", |
688 | dev->nodename); | 688 | dev->nodename); |
689 | 689 | ||
690 | return; | 690 | return; |
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c index 6c7fd7db6df..fb1975d82a7 100644 --- a/drivers/block/xsysace.c +++ b/drivers/block/xsysace.c | |||
@@ -1155,12 +1155,19 @@ static int __devinit ace_probe(struct platform_device *dev) | |||
1155 | { | 1155 | { |
1156 | resource_size_t physaddr = 0; | 1156 | resource_size_t physaddr = 0; |
1157 | int bus_width = ACE_BUS_WIDTH_16; /* FIXME: should not be hard coded */ | 1157 | int bus_width = ACE_BUS_WIDTH_16; /* FIXME: should not be hard coded */ |
1158 | int id = dev->id; | 1158 | u32 id = dev->id; |
1159 | int irq = NO_IRQ; | 1159 | int irq = NO_IRQ; |
1160 | int i; | 1160 | int i; |
1161 | 1161 | ||
1162 | dev_dbg(&dev->dev, "ace_probe(%p)\n", dev); | 1162 | dev_dbg(&dev->dev, "ace_probe(%p)\n", dev); |
1163 | 1163 | ||
1164 | /* device id and bus width */ | ||
1165 | of_property_read_u32(dev->dev.of_node, "port-number", &id); | ||
1166 | if (id < 0) | ||
1167 | id = 0; | ||
1168 | if (of_find_property(dev->dev.of_node, "8-bit", NULL)) | ||
1169 | bus_width = ACE_BUS_WIDTH_8; | ||
1170 | |||
1164 | for (i = 0; i < dev->num_resources; i++) { | 1171 | for (i = 0; i < dev->num_resources; i++) { |
1165 | if (dev->resource[i].flags & IORESOURCE_MEM) | 1172 | if (dev->resource[i].flags & IORESOURCE_MEM) |
1166 | physaddr = dev->resource[i].start; | 1173 | physaddr = dev->resource[i].start; |
@@ -1181,57 +1188,7 @@ static int __devexit ace_remove(struct platform_device *dev) | |||
1181 | return 0; | 1188 | return 0; |
1182 | } | 1189 | } |
1183 | 1190 | ||
1184 | static struct platform_driver ace_platform_driver = { | ||
1185 | .probe = ace_probe, | ||
1186 | .remove = __devexit_p(ace_remove), | ||
1187 | .driver = { | ||
1188 | .owner = THIS_MODULE, | ||
1189 | .name = "xsysace", | ||
1190 | }, | ||
1191 | }; | ||
1192 | |||
1193 | /* --------------------------------------------------------------------- | ||
1194 | * OF_Platform Bus Support | ||
1195 | */ | ||
1196 | |||
1197 | #if defined(CONFIG_OF) | 1191 | #if defined(CONFIG_OF) |
1198 | static int __devinit ace_of_probe(struct platform_device *op) | ||
1199 | { | ||
1200 | struct resource res; | ||
1201 | resource_size_t physaddr; | ||
1202 | const u32 *id; | ||
1203 | int irq, bus_width, rc; | ||
1204 | |||
1205 | /* device id */ | ||
1206 | id = of_get_property(op->dev.of_node, "port-number", NULL); | ||
1207 | |||
1208 | /* physaddr */ | ||
1209 | rc = of_address_to_resource(op->dev.of_node, 0, &res); | ||
1210 | if (rc) { | ||
1211 | dev_err(&op->dev, "invalid address\n"); | ||
1212 | return rc; | ||
1213 | } | ||
1214 | physaddr = res.start; | ||
1215 | |||
1216 | /* irq */ | ||
1217 | irq = irq_of_parse_and_map(op->dev.of_node, 0); | ||
1218 | |||
1219 | /* bus width */ | ||
1220 | bus_width = ACE_BUS_WIDTH_16; | ||
1221 | if (of_find_property(op->dev.of_node, "8-bit", NULL)) | ||
1222 | bus_width = ACE_BUS_WIDTH_8; | ||
1223 | |||
1224 | /* Call the bus-independent setup code */ | ||
1225 | return ace_alloc(&op->dev, id ? be32_to_cpup(id) : 0, | ||
1226 | physaddr, irq, bus_width); | ||
1227 | } | ||
1228 | |||
1229 | static int __devexit ace_of_remove(struct platform_device *op) | ||
1230 | { | ||
1231 | ace_free(&op->dev); | ||
1232 | return 0; | ||
1233 | } | ||
1234 | |||
1235 | /* Match table for of_platform binding */ | 1192 | /* Match table for of_platform binding */ |
1236 | static const struct of_device_id ace_of_match[] __devinitconst = { | 1193 | static const struct of_device_id ace_of_match[] __devinitconst = { |
1237 | { .compatible = "xlnx,opb-sysace-1.00.b", }, | 1194 | { .compatible = "xlnx,opb-sysace-1.00.b", }, |
@@ -1241,34 +1198,20 @@ static const struct of_device_id ace_of_match[] __devinitconst = { | |||
1241 | {}, | 1198 | {}, |
1242 | }; | 1199 | }; |
1243 | MODULE_DEVICE_TABLE(of, ace_of_match); | 1200 | MODULE_DEVICE_TABLE(of, ace_of_match); |
1201 | #else /* CONFIG_OF */ | ||
1202 | #define ace_of_match NULL | ||
1203 | #endif /* CONFIG_OF */ | ||
1244 | 1204 | ||
1245 | static struct platform_driver ace_of_driver = { | 1205 | static struct platform_driver ace_platform_driver = { |
1246 | .probe = ace_of_probe, | 1206 | .probe = ace_probe, |
1247 | .remove = __devexit_p(ace_of_remove), | 1207 | .remove = __devexit_p(ace_remove), |
1248 | .driver = { | 1208 | .driver = { |
1249 | .name = "xsysace", | ||
1250 | .owner = THIS_MODULE, | 1209 | .owner = THIS_MODULE, |
1210 | .name = "xsysace", | ||
1251 | .of_match_table = ace_of_match, | 1211 | .of_match_table = ace_of_match, |
1252 | }, | 1212 | }, |
1253 | }; | 1213 | }; |
1254 | 1214 | ||
1255 | /* Registration helpers to keep the number of #ifdefs to a minimum */ | ||
1256 | static inline int __init ace_of_register(void) | ||
1257 | { | ||
1258 | pr_debug("xsysace: registering OF binding\n"); | ||
1259 | return platform_driver_register(&ace_of_driver); | ||
1260 | } | ||
1261 | |||
1262 | static inline void __exit ace_of_unregister(void) | ||
1263 | { | ||
1264 | platform_driver_unregister(&ace_of_driver); | ||
1265 | } | ||
1266 | #else /* CONFIG_OF */ | ||
1267 | /* CONFIG_OF not enabled; do nothing helpers */ | ||
1268 | static inline int __init ace_of_register(void) { return 0; } | ||
1269 | static inline void __exit ace_of_unregister(void) { } | ||
1270 | #endif /* CONFIG_OF */ | ||
1271 | |||
1272 | /* --------------------------------------------------------------------- | 1215 | /* --------------------------------------------------------------------- |
1273 | * Module init/exit routines | 1216 | * Module init/exit routines |
1274 | */ | 1217 | */ |
@@ -1282,11 +1225,6 @@ static int __init ace_init(void) | |||
1282 | goto err_blk; | 1225 | goto err_blk; |
1283 | } | 1226 | } |
1284 | 1227 | ||
1285 | rc = ace_of_register(); | ||
1286 | if (rc) | ||
1287 | goto err_of; | ||
1288 | |||
1289 | pr_debug("xsysace: registering platform binding\n"); | ||
1290 | rc = platform_driver_register(&ace_platform_driver); | 1228 | rc = platform_driver_register(&ace_platform_driver); |
1291 | if (rc) | 1229 | if (rc) |
1292 | goto err_plat; | 1230 | goto err_plat; |
@@ -1295,21 +1233,17 @@ static int __init ace_init(void) | |||
1295 | return 0; | 1233 | return 0; |
1296 | 1234 | ||
1297 | err_plat: | 1235 | err_plat: |
1298 | ace_of_unregister(); | ||
1299 | err_of: | ||
1300 | unregister_blkdev(ace_major, "xsysace"); | 1236 | unregister_blkdev(ace_major, "xsysace"); |
1301 | err_blk: | 1237 | err_blk: |
1302 | printk(KERN_ERR "xsysace: registration failed; err=%i\n", rc); | 1238 | printk(KERN_ERR "xsysace: registration failed; err=%i\n", rc); |
1303 | return rc; | 1239 | return rc; |
1304 | } | 1240 | } |
1241 | module_init(ace_init); | ||
1305 | 1242 | ||
1306 | static void __exit ace_exit(void) | 1243 | static void __exit ace_exit(void) |
1307 | { | 1244 | { |
1308 | pr_debug("Unregistering Xilinx SystemACE driver\n"); | 1245 | pr_debug("Unregistering Xilinx SystemACE driver\n"); |
1309 | platform_driver_unregister(&ace_platform_driver); | 1246 | platform_driver_unregister(&ace_platform_driver); |
1310 | ace_of_unregister(); | ||
1311 | unregister_blkdev(ace_major, "xsysace"); | 1247 | unregister_blkdev(ace_major, "xsysace"); |
1312 | } | 1248 | } |
1313 | |||
1314 | module_init(ace_init); | ||
1315 | module_exit(ace_exit); | 1249 | module_exit(ace_exit); |