summaryrefslogtreecommitdiff
path: root/arch/m68k/emu/nfblock.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/m68k/emu/nfblock.c')
-rw-r--r--arch/m68k/emu/nfblock.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/m68k/emu/nfblock.c b/arch/m68k/emu/nfblock.c
index 83410f8184ec..fa6256c5af22 100644
--- a/arch/m68k/emu/nfblock.c
+++ b/arch/m68k/emu/nfblock.c
@@ -77,9 +77,9 @@ static void nfhd_submit_bio(struct bio *bio)
bio_endio(bio);
}
-static int nfhd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
+static int nfhd_getgeo(struct gendisk *disk, struct hd_geometry *geo)
{
- struct nfhd_device *dev = bdev->bd_disk->private_data;
+ struct nfhd_device *dev = disk->private_data;
geo->cylinders = dev->blocks >> (6 - dev->bshift);
geo->heads = 4;
@@ -112,7 +112,7 @@ static int __init nfhd_init_one(int id, u32 blocks, u32 bsize)
return -EINVAL;
}
- dev = kmalloc(sizeof(struct nfhd_device), GFP_KERNEL);
+ dev = kmalloc_obj(struct nfhd_device);
if (!dev)
goto out;
@@ -132,7 +132,8 @@ static int __init nfhd_init_one(int id, u32 blocks, u32 bsize)
dev->disk->minors = 16;
dev->disk->fops = &nfhd_ops;
dev->disk->private_data = dev;
- sprintf(dev->disk->disk_name, "nfhd%u", dev_id);
+ snprintf(dev->disk->disk_name, sizeof(dev->disk->disk_name), "nfhd%u",
+ dev_id);
set_capacity(dev->disk, (sector_t)blocks * (bsize / 512));
err = add_disk(dev->disk);
if (err)