diff options
Diffstat (limited to 'drivers/block/xsysace.c')
-rw-r--r-- | drivers/block/xsysace.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c index e1c95e208a66..b71888b909a0 100644 --- a/drivers/block/xsysace.c +++ b/drivers/block/xsysace.c | |||
@@ -89,6 +89,7 @@ | |||
89 | #include <linux/delay.h> | 89 | #include <linux/delay.h> |
90 | #include <linux/slab.h> | 90 | #include <linux/slab.h> |
91 | #include <linux/blkdev.h> | 91 | #include <linux/blkdev.h> |
92 | #include <linux/smp_lock.h> | ||
92 | #include <linux/ata.h> | 93 | #include <linux/ata.h> |
93 | #include <linux/hdreg.h> | 94 | #include <linux/hdreg.h> |
94 | #include <linux/platform_device.h> | 95 | #include <linux/platform_device.h> |
@@ -465,7 +466,7 @@ struct request *ace_get_next_request(struct request_queue * q) | |||
465 | struct request *req; | 466 | struct request *req; |
466 | 467 | ||
467 | while ((req = blk_peek_request(q)) != NULL) { | 468 | while ((req = blk_peek_request(q)) != NULL) { |
468 | if (blk_fs_request(req)) | 469 | if (req->cmd_type == REQ_TYPE_FS) |
469 | break; | 470 | break; |
470 | blk_start_request(req); | 471 | blk_start_request(req); |
471 | __blk_end_request_all(req, -EIO); | 472 | __blk_end_request_all(req, -EIO); |
@@ -901,11 +902,14 @@ static int ace_open(struct block_device *bdev, fmode_t mode) | |||
901 | 902 | ||
902 | dev_dbg(ace->dev, "ace_open() users=%i\n", ace->users + 1); | 903 | dev_dbg(ace->dev, "ace_open() users=%i\n", ace->users + 1); |
903 | 904 | ||
905 | lock_kernel(); | ||
904 | spin_lock_irqsave(&ace->lock, flags); | 906 | spin_lock_irqsave(&ace->lock, flags); |
905 | ace->users++; | 907 | ace->users++; |
906 | spin_unlock_irqrestore(&ace->lock, flags); | 908 | spin_unlock_irqrestore(&ace->lock, flags); |
907 | 909 | ||
908 | check_disk_change(bdev); | 910 | check_disk_change(bdev); |
911 | unlock_kernel(); | ||
912 | |||
909 | return 0; | 913 | return 0; |
910 | } | 914 | } |
911 | 915 | ||
@@ -917,6 +921,7 @@ static int ace_release(struct gendisk *disk, fmode_t mode) | |||
917 | 921 | ||
918 | dev_dbg(ace->dev, "ace_release() users=%i\n", ace->users - 1); | 922 | dev_dbg(ace->dev, "ace_release() users=%i\n", ace->users - 1); |
919 | 923 | ||
924 | lock_kernel(); | ||
920 | spin_lock_irqsave(&ace->lock, flags); | 925 | spin_lock_irqsave(&ace->lock, flags); |
921 | ace->users--; | 926 | ace->users--; |
922 | if (ace->users == 0) { | 927 | if (ace->users == 0) { |
@@ -924,6 +929,7 @@ static int ace_release(struct gendisk *disk, fmode_t mode) | |||
924 | ace_out(ace, ACE_CTRL, val & ~ACE_CTRL_LOCKREQ); | 929 | ace_out(ace, ACE_CTRL, val & ~ACE_CTRL_LOCKREQ); |
925 | } | 930 | } |
926 | spin_unlock_irqrestore(&ace->lock, flags); | 931 | spin_unlock_irqrestore(&ace->lock, flags); |
932 | unlock_kernel(); | ||
927 | return 0; | 933 | return 0; |
928 | } | 934 | } |
929 | 935 | ||
@@ -1198,10 +1204,10 @@ ace_of_probe(struct of_device *op, const struct of_device_id *match) | |||
1198 | dev_dbg(&op->dev, "ace_of_probe(%p, %p)\n", op, match); | 1204 | dev_dbg(&op->dev, "ace_of_probe(%p, %p)\n", op, match); |
1199 | 1205 | ||
1200 | /* device id */ | 1206 | /* device id */ |
1201 | id = of_get_property(op->node, "port-number", NULL); | 1207 | id = of_get_property(op->dev.of_node, "port-number", NULL); |
1202 | 1208 | ||
1203 | /* physaddr */ | 1209 | /* physaddr */ |
1204 | rc = of_address_to_resource(op->node, 0, &res); | 1210 | rc = of_address_to_resource(op->dev.of_node, 0, &res); |
1205 | if (rc) { | 1211 | if (rc) { |
1206 | dev_err(&op->dev, "invalid address\n"); | 1212 | dev_err(&op->dev, "invalid address\n"); |
1207 | return rc; | 1213 | return rc; |
@@ -1209,11 +1215,11 @@ ace_of_probe(struct of_device *op, const struct of_device_id *match) | |||
1209 | physaddr = res.start; | 1215 | physaddr = res.start; |
1210 | 1216 | ||
1211 | /* irq */ | 1217 | /* irq */ |
1212 | irq = irq_of_parse_and_map(op->node, 0); | 1218 | irq = irq_of_parse_and_map(op->dev.of_node, 0); |
1213 | 1219 | ||
1214 | /* bus width */ | 1220 | /* bus width */ |
1215 | bus_width = ACE_BUS_WIDTH_16; | 1221 | bus_width = ACE_BUS_WIDTH_16; |
1216 | if (of_find_property(op->node, "8-bit", NULL)) | 1222 | if (of_find_property(op->dev.of_node, "8-bit", NULL)) |
1217 | bus_width = ACE_BUS_WIDTH_8; | 1223 | bus_width = ACE_BUS_WIDTH_8; |
1218 | 1224 | ||
1219 | /* Call the bus-independant setup code */ | 1225 | /* Call the bus-independant setup code */ |
@@ -1237,13 +1243,12 @@ static const struct of_device_id ace_of_match[] __devinitconst = { | |||
1237 | MODULE_DEVICE_TABLE(of, ace_of_match); | 1243 | MODULE_DEVICE_TABLE(of, ace_of_match); |
1238 | 1244 | ||
1239 | static struct of_platform_driver ace_of_driver = { | 1245 | static struct of_platform_driver ace_of_driver = { |
1240 | .owner = THIS_MODULE, | ||
1241 | .name = "xsysace", | ||
1242 | .match_table = ace_of_match, | ||
1243 | .probe = ace_of_probe, | 1246 | .probe = ace_of_probe, |
1244 | .remove = __devexit_p(ace_of_remove), | 1247 | .remove = __devexit_p(ace_of_remove), |
1245 | .driver = { | 1248 | .driver = { |
1246 | .name = "xsysace", | 1249 | .name = "xsysace", |
1250 | .owner = THIS_MODULE, | ||
1251 | .of_match_table = ace_of_match, | ||
1247 | }, | 1252 | }, |
1248 | }; | 1253 | }; |
1249 | 1254 | ||