diff options
author | Markus Lidel <Markus.Lidel@shadowconnect.com> | 2006-01-06 03:19:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 11:33:53 -0500 |
commit | 793fd15d9fafe5b1c71e50d3c041f1463895dbde (patch) | |
tree | a19f3f17b435a3600d19f5a5ee2136b2d3646987 /drivers/message/i2o/i2o_block.c | |
parent | a1a5ea70a6e9db6332b27fe2d96666e17aa1436b (diff) |
[PATCH] I2O: SPARC fixes
Fix lot of BE <-> LE bugs which prevent it from working on SPARC.
Signed-off-by: Markus Lidel <Markus.Lidel@shadowconnect.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/message/i2o/i2o_block.c')
-rw-r--r-- | drivers/message/i2o/i2o_block.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c index 2bd15c70773b..ed2df54bf464 100644 --- a/drivers/message/i2o/i2o_block.c +++ b/drivers/message/i2o/i2o_block.c | |||
@@ -1050,8 +1050,8 @@ static int i2o_block_probe(struct device *dev) | |||
1050 | int rc; | 1050 | int rc; |
1051 | u64 size; | 1051 | u64 size; |
1052 | u32 blocksize; | 1052 | u32 blocksize; |
1053 | u32 flags, status; | ||
1054 | u16 body_size = 4; | 1053 | u16 body_size = 4; |
1054 | u16 power; | ||
1055 | unsigned short max_sectors; | 1055 | unsigned short max_sectors; |
1056 | 1056 | ||
1057 | #ifdef CONFIG_I2O_EXT_ADAPTEC | 1057 | #ifdef CONFIG_I2O_EXT_ADAPTEC |
@@ -1109,22 +1109,20 @@ static int i2o_block_probe(struct device *dev) | |||
1109 | * Ask for the current media data. If that isn't supported | 1109 | * Ask for the current media data. If that isn't supported |
1110 | * then we ask for the device capacity data | 1110 | * then we ask for the device capacity data |
1111 | */ | 1111 | */ |
1112 | if (i2o_parm_field_get(i2o_dev, 0x0004, 1, &blocksize, 4) || | 1112 | if (!i2o_parm_field_get(i2o_dev, 0x0004, 1, &blocksize, 4) || |
1113 | i2o_parm_field_get(i2o_dev, 0x0000, 3, &blocksize, 4)) { | 1113 | !i2o_parm_field_get(i2o_dev, 0x0000, 3, &blocksize, 4)) { |
1114 | blk_queue_hardsect_size(queue, blocksize); | 1114 | blk_queue_hardsect_size(queue, le32_to_cpu(blocksize)); |
1115 | } else | 1115 | } else |
1116 | osm_warn("unable to get blocksize of %s\n", gd->disk_name); | 1116 | osm_warn("unable to get blocksize of %s\n", gd->disk_name); |
1117 | 1117 | ||
1118 | if (i2o_parm_field_get(i2o_dev, 0x0004, 0, &size, 8) || | 1118 | if (!i2o_parm_field_get(i2o_dev, 0x0004, 0, &size, 8) || |
1119 | i2o_parm_field_get(i2o_dev, 0x0000, 4, &size, 8)) { | 1119 | !i2o_parm_field_get(i2o_dev, 0x0000, 4, &size, 8)) { |
1120 | set_capacity(gd, size >> KERNEL_SECTOR_SHIFT); | 1120 | set_capacity(gd, le64_to_cpu(size) >> KERNEL_SECTOR_SHIFT); |
1121 | } else | 1121 | } else |
1122 | osm_warn("could not get size of %s\n", gd->disk_name); | 1122 | osm_warn("could not get size of %s\n", gd->disk_name); |
1123 | 1123 | ||
1124 | if (!i2o_parm_field_get(i2o_dev, 0x0000, 2, &i2o_blk_dev->power, 2)) | 1124 | if (!i2o_parm_field_get(i2o_dev, 0x0000, 2, &power, 2)) |
1125 | i2o_blk_dev->power = 0; | 1125 | i2o_blk_dev->power = power; |
1126 | i2o_parm_field_get(i2o_dev, 0x0000, 5, &flags, 4); | ||
1127 | i2o_parm_field_get(i2o_dev, 0x0000, 6, &status, 4); | ||
1128 | 1126 | ||
1129 | i2o_event_register(i2o_dev, &i2o_block_driver, 0, 0xffffffff); | 1127 | i2o_event_register(i2o_dev, &i2o_block_driver, 0, 0xffffffff); |
1130 | 1128 | ||