diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 07:46:22 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 07:46:22 -0400 |
commit | e354c1d8033d97a97a38a1b2cffa1bc285b92ad4 (patch) | |
tree | cd520f7cd4a417c1f78d81e3a3b62936697b35f6 /drivers/ide/falconide.c | |
parent | d15a613ba01ff2b209ecad7a38ccbb23b3b06c92 (diff) |
ide: remove IDE_ARCH_LOCK (v2)
* Add ->{get,release}_lock methods to struct ide_port_info
and struct ide_host.
* Convert core IDE code, m68k IDE code and falconide support to use
->{get,release}_lock methods instead of ide_{get,release}_lock().
* Remove IDE_ARCH_LOCK.
v2:
* Build fix from Geert updating ide_{get,release}_lock() callers in
falconide.c.
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Michael Schmitz <schmitz@debian.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/falconide.c')
-rw-r--r-- | drivers/ide/falconide.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/drivers/ide/falconide.c b/drivers/ide/falconide.c index a638e952d67a..d4d7ff1a3516 100644 --- a/drivers/ide/falconide.c +++ b/drivers/ide/falconide.c | |||
@@ -40,8 +40,27 @@ | |||
40 | * which is shared between several drivers. | 40 | * which is shared between several drivers. |
41 | */ | 41 | */ |
42 | 42 | ||
43 | int falconide_intr_lock; | 43 | static int falconide_intr_lock; |
44 | EXPORT_SYMBOL(falconide_intr_lock); | 44 | |
45 | static void falconide_release_lock(void) | ||
46 | { | ||
47 | if (falconide_intr_lock == 0) { | ||
48 | printk(KERN_ERR "%s: bug\n", __func__); | ||
49 | return; | ||
50 | } | ||
51 | falconide_intr_lock = 0; | ||
52 | stdma_release(); | ||
53 | } | ||
54 | |||
55 | static void falconide_get_lock(irq_handler_t handler, void *data) | ||
56 | { | ||
57 | if (falconide_intr_lock == 0) { | ||
58 | if (in_interrupt() > 0) | ||
59 | panic("Falcon IDE hasn't ST-DMA lock in interrupt"); | ||
60 | stdma_lock(handler, data); | ||
61 | falconide_intr_lock = 1; | ||
62 | } | ||
63 | } | ||
45 | 64 | ||
46 | static void falconide_input_data(ide_drive_t *drive, struct request *rq, | 65 | static void falconide_input_data(ide_drive_t *drive, struct request *rq, |
47 | void *buf, unsigned int len) | 66 | void *buf, unsigned int len) |
@@ -81,6 +100,8 @@ static const struct ide_tp_ops falconide_tp_ops = { | |||
81 | }; | 100 | }; |
82 | 101 | ||
83 | static const struct ide_port_info falconide_port_info = { | 102 | static const struct ide_port_info falconide_port_info = { |
103 | .get_lock = falconide_get_lock, | ||
104 | .release_lock = falconide_release_lock, | ||
84 | .tp_ops = &falconide_tp_ops, | 105 | .tp_ops = &falconide_tp_ops, |
85 | .host_flags = IDE_HFLAG_NO_DMA | IDE_HFLAG_SERIALIZE, | 106 | .host_flags = IDE_HFLAG_NO_DMA | IDE_HFLAG_SERIALIZE, |
86 | }; | 107 | }; |
@@ -132,9 +153,9 @@ static int __init falconide_init(void) | |||
132 | goto err; | 153 | goto err; |
133 | } | 154 | } |
134 | 155 | ||
135 | ide_get_lock(NULL, NULL); | 156 | falconide_get_lock(NULL, NULL); |
136 | rc = ide_host_register(host, &falconide_port_info, hws); | 157 | rc = ide_host_register(host, &falconide_port_info, hws); |
137 | ide_release_lock(); | 158 | falconide_release_lock(); |
138 | 159 | ||
139 | if (rc) | 160 | if (rc) |
140 | goto err_free; | 161 | goto err_free; |