aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/axonram.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/sysdev/axonram.c')
-rw-r--r--arch/powerpc/sysdev/axonram.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c
index 9b639ede06da..9e105cbc5e5f 100644
--- a/arch/powerpc/sysdev/axonram.c
+++ b/arch/powerpc/sysdev/axonram.c
@@ -150,7 +150,10 @@ axon_ram_direct_access(struct block_device *device, sector_t sector,
150 struct axon_ram_bank *bank = device->bd_disk->private_data; 150 struct axon_ram_bank *bank = device->bd_disk->private_data;
151 loff_t offset; 151 loff_t offset;
152 152
153 offset = sector << AXON_RAM_SECTOR_SHIFT; 153 offset = sector;
154 if (device->bd_part != NULL)
155 offset += device->bd_part->start_sect;
156 offset <<= AXON_RAM_SECTOR_SHIFT;
154 if (offset >= bank->size) { 157 if (offset >= bank->size) {
155 dev_err(&bank->device->dev, "Access outside of address space\n"); 158 dev_err(&bank->device->dev, "Access outside of address space\n");
156 return -ERANGE; 159 return -ERANGE;