aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-ioctls.c
diff options
context:
space:
mode:
authorElias Oltmanns <eo@nebensachen.de>2008-10-10 16:39:40 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 16:39:40 -0400
commit92f1f8fd8040e7b50a67a850a935509bb01201bb (patch)
treedf27468982bc64f0a6fdc54f05153e382ca63a1b /drivers/ide/ide-ioctls.c
parentd6e2955a6b82d2312b5ff885ce13c8ab54d59d96 (diff)
ide: Remove ide_spin_wait_hwgroup() and use special requests instead
Use a special request for serialisation purposes and get rid of the awkward ide_spin_wait_hwgroup(). This also involves converting the ide_devset structure so it can be shared by the /proc and the ioctl code. Signed-off-by: Elias Oltmanns <eo@nebensachen.de> [bart: use rq->cmd[] directly] Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-ioctls.c')
-rw-r--r--drivers/ide/ide-ioctls.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/ide/ide-ioctls.c b/drivers/ide/ide-ioctls.c
index 7a0d62e7286b..cf01564901af 100644
--- a/drivers/ide/ide-ioctls.c
+++ b/drivers/ide/ide-ioctls.c
@@ -6,11 +6,11 @@
6#include <linux/ide.h> 6#include <linux/ide.h>
7 7
8static const struct ide_ioctl_devset ide_ioctl_settings[] = { 8static const struct ide_ioctl_devset ide_ioctl_settings[] = {
9{ HDIO_GET_32BIT, HDIO_SET_32BIT, get_io_32bit, set_io_32bit }, 9{ HDIO_GET_32BIT, HDIO_SET_32BIT, &ide_devset_io_32bit },
10{ HDIO_GET_KEEPSETTINGS, HDIO_SET_KEEPSETTINGS, get_ksettings, set_ksettings }, 10{ HDIO_GET_KEEPSETTINGS, HDIO_SET_KEEPSETTINGS, &ide_devset_keepsettings },
11{ HDIO_GET_UNMASKINTR, HDIO_SET_UNMASKINTR, get_unmaskirq, set_unmaskirq }, 11{ HDIO_GET_UNMASKINTR, HDIO_SET_UNMASKINTR, &ide_devset_unmaskirq },
12{ HDIO_GET_DMA, HDIO_SET_DMA, get_using_dma, set_using_dma }, 12{ HDIO_GET_DMA, HDIO_SET_DMA, &ide_devset_using_dma },
13{ -1, HDIO_SET_PIO_MODE, NULL, set_pio_mode }, 13{ -1, HDIO_SET_PIO_MODE, &ide_devset_pio_mode },
14{ 0 } 14{ 0 }
15}; 15};
16 16
@@ -18,13 +18,14 @@ int ide_setting_ioctl(ide_drive_t *drive, struct block_device *bdev,
18 unsigned int cmd, unsigned long arg, 18 unsigned int cmd, unsigned long arg,
19 const struct ide_ioctl_devset *s) 19 const struct ide_ioctl_devset *s)
20{ 20{
21 const struct ide_devset *ds;
21 unsigned long flags; 22 unsigned long flags;
22 int err = -EOPNOTSUPP; 23 int err = -EOPNOTSUPP;
23 24
24 for (; s->get_ioctl; s++) { 25 for (; (ds = s->setting); s++) {
25 if (s->get && s->get_ioctl == cmd) 26 if (ds->get && s->get_ioctl == cmd)
26 goto read_val; 27 goto read_val;
27 else if (s->set && s->set_ioctl == cmd) 28 else if (ds->set && s->set_ioctl == cmd)
28 goto set_val; 29 goto set_val;
29 } 30 }
30 31
@@ -33,7 +34,7 @@ int ide_setting_ioctl(ide_drive_t *drive, struct block_device *bdev,
33read_val: 34read_val:
34 mutex_lock(&ide_setting_mtx); 35 mutex_lock(&ide_setting_mtx);
35 spin_lock_irqsave(&ide_lock, flags); 36 spin_lock_irqsave(&ide_lock, flags);
36 err = s->get(drive); 37 err = ds->get(drive);
37 spin_unlock_irqrestore(&ide_lock, flags); 38 spin_unlock_irqrestore(&ide_lock, flags);
38 mutex_unlock(&ide_setting_mtx); 39 mutex_unlock(&ide_setting_mtx);
39 return err >= 0 ? put_user(err, (long __user *)arg) : err; 40 return err >= 0 ? put_user(err, (long __user *)arg) : err;
@@ -46,7 +47,7 @@ set_val:
46 err = -EACCES; 47 err = -EACCES;
47 else { 48 else {
48 mutex_lock(&ide_setting_mtx); 49 mutex_lock(&ide_setting_mtx);
49 err = s->set(drive, arg); 50 err = ide_devset_execute(drive, ds, arg);
50 mutex_unlock(&ide_setting_mtx); 51 mutex_unlock(&ide_setting_mtx);
51 } 52 }
52 } 53 }