summaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2015-01-14 05:58:45 +0100
committerJens Axboe <axboe@fb.com>2015-01-14 05:58:45 +0100
commitd4119ee0e1aa2b74e5e367cbc915e79db7b9e271 (patch)
treedae4e7bebdda0db62a00c5bb3d054a6018d68444 /arch/powerpc
parentaxonram: Fix bug in direct_access (diff)
parentblock: Change direct_access calling convention (diff)
downloadlinux-d4119ee0e1aa2b74e5e367cbc915e79db7b9e271.tar.xz
linux-d4119ee0e1aa2b74e5e367cbc915e79db7b9e271.zip
Merge branch 'for-3.20/core' into for-3.20/drivers
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/sysdev/axonram.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c
index 367533bb3d48..ee90db17b097 100644
--- a/arch/powerpc/sysdev/axonram.c
+++ b/arch/powerpc/sysdev/axonram.c
@@ -139,26 +139,17 @@ axon_ram_make_request(struct request_queue *queue, struct bio *bio)
* axon_ram_direct_access - direct_access() method for block device
* @device, @sector, @data: see block_device_operations method
*/
-static int
+static long
axon_ram_direct_access(struct block_device *device, sector_t sector,
- void **kaddr, unsigned long *pfn)
+ void **kaddr, unsigned long *pfn, long size)
{
struct axon_ram_bank *bank = device->bd_disk->private_data;
- loff_t offset;
-
- offset = sector;
- if (device->bd_part != NULL)
- offset += device->bd_part->start_sect;
- offset <<= AXON_RAM_SECTOR_SHIFT;
- if (offset >= bank->size) {
- dev_err(&bank->device->dev, "Access outside of address space\n");
- return -ERANGE;
- }
+ loff_t offset = (loff_t)sector << AXON_RAM_SECTOR_SHIFT;
*kaddr = (void *)(bank->ph_addr + offset);
*pfn = virt_to_phys(*kaddr) >> PAGE_SHIFT;
- return 0;
+ return bank->size - offset;
}
static const struct block_device_operations axon_ram_devops = {