diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-04-01 21:42:21 +0200 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-04-01 21:42:21 +0200 |
commit | 73855e13b2bce2bb5cd2a62c270fb07f49353e02 (patch) | |
tree | 0af006a591ad75d0450c651b558694b96bf1d6ea /arch/um/drivers | |
parent | d8881cdab5e1810b0a03b480ed16c1e761e68257 (diff) |
ubd_kern: make it 'struct hd_driveid'-free
* Change ubd_id in ubd_ioctl() from 'struct hd_driveid *id'
to 'u16 *id' and update driver accordingly.
* Include <linux/ata.h> directly instead of through <linux/hdreg.h>.
There should be no functional changes caused by this patch.
Cc: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'arch/um/drivers')
-rw-r--r-- | arch/um/drivers/ubd_kern.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index d42f826a8ab..f934225fd8e 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c @@ -22,6 +22,7 @@ #include "linux/kernel.h" #include "linux/module.h" #include "linux/blkdev.h" +#include "linux/ata.h" #include "linux/hdreg.h" #include "linux/init.h" #include "linux/cdrom.h" @@ -1308,16 +1309,15 @@ static int ubd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg) { struct ubd *ubd_dev = bdev->bd_disk->private_data; - struct hd_driveid ubd_id = { - .cyls = 0, - .heads = 128, - .sectors = 32, - }; + u16 ubd_id[ATA_ID_WORDS]; switch (cmd) { struct cdrom_volctrl volume; case HDIO_GET_IDENTITY: - ubd_id.cyls = ubd_dev->size / (128 * 32 * 512); + memset(&ubd_id, 0, ATA_ID_WORDS * 2); + ubd_id[ATA_ID_CYLS] = ubd_dev->size / (128 * 32 * 512); + ubd_id[ATA_ID_HEADS] = 128; + ubd_id[ATA_ID_SECTORS] = 32; if(copy_to_user((char __user *) arg, (char *) &ubd_id, sizeof(ubd_id))) return -EFAULT; |