diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:21:06 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:21:06 -0500 |
commit | fba395eee7d3f342ca739c20f5b3ee635d0420a0 (patch) | |
tree | 5a73f68d3514aa795b0d8c500e4d72170651d762 /drivers/scsi/pcmcia/fdomain_stub.c | |
parent | fd238232cd0ff4840ae6946bb338502154096d88 (diff) |
[PATCH] pcmcia: remove dev_link_t and client_handle_t indirection
dev_link_t * and client_handle_t both mean struct pcmcai_device * by now.
Therefore, remove all such indirections.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/scsi/pcmcia/fdomain_stub.c')
-rw-r--r-- | drivers/scsi/pcmcia/fdomain_stub.c | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c index 94dcee9f285a..4e6927112c05 100644 --- a/drivers/scsi/pcmcia/fdomain_stub.c +++ b/drivers/scsi/pcmcia/fdomain_stub.c | |||
@@ -79,14 +79,13 @@ typedef struct scsi_info_t { | |||
79 | } scsi_info_t; | 79 | } scsi_info_t; |
80 | 80 | ||
81 | 81 | ||
82 | static void fdomain_release(dev_link_t *link); | 82 | static void fdomain_release(struct pcmcia_device *link); |
83 | static void fdomain_detach(struct pcmcia_device *p_dev); | 83 | static void fdomain_detach(struct pcmcia_device *p_dev); |
84 | static void fdomain_config(dev_link_t *link); | 84 | static void fdomain_config(struct pcmcia_device *link); |
85 | 85 | ||
86 | static int fdomain_attach(struct pcmcia_device *p_dev) | 86 | static int fdomain_attach(struct pcmcia_device *link) |
87 | { | 87 | { |
88 | scsi_info_t *info; | 88 | scsi_info_t *info; |
89 | dev_link_t *link = dev_to_instance(p_dev); | ||
90 | 89 | ||
91 | DEBUG(0, "fdomain_attach()\n"); | 90 | DEBUG(0, "fdomain_attach()\n"); |
92 | 91 | ||
@@ -94,7 +93,7 @@ static int fdomain_attach(struct pcmcia_device *p_dev) | |||
94 | info = kmalloc(sizeof(*info), GFP_KERNEL); | 93 | info = kmalloc(sizeof(*info), GFP_KERNEL); |
95 | if (!info) return -ENOMEM; | 94 | if (!info) return -ENOMEM; |
96 | memset(info, 0, sizeof(*info)); | 95 | memset(info, 0, sizeof(*info)); |
97 | info->p_dev = p_dev; | 96 | info->p_dev = link; |
98 | link->priv = info; | 97 | link->priv = info; |
99 | link->io.NumPorts1 = 0x10; | 98 | link->io.NumPorts1 = 0x10; |
100 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 99 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; |
@@ -113,10 +112,8 @@ static int fdomain_attach(struct pcmcia_device *p_dev) | |||
113 | 112 | ||
114 | /*====================================================================*/ | 113 | /*====================================================================*/ |
115 | 114 | ||
116 | static void fdomain_detach(struct pcmcia_device *p_dev) | 115 | static void fdomain_detach(struct pcmcia_device *link) |
117 | { | 116 | { |
118 | dev_link_t *link = dev_to_instance(p_dev); | ||
119 | |||
120 | DEBUG(0, "fdomain_detach(0x%p)\n", link); | 117 | DEBUG(0, "fdomain_detach(0x%p)\n", link); |
121 | 118 | ||
122 | if (link->state & DEV_CONFIG) | 119 | if (link->state & DEV_CONFIG) |
@@ -130,9 +127,8 @@ static void fdomain_detach(struct pcmcia_device *p_dev) | |||
130 | #define CS_CHECK(fn, ret) \ | 127 | #define CS_CHECK(fn, ret) \ |
131 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 128 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
132 | 129 | ||
133 | static void fdomain_config(dev_link_t *link) | 130 | static void fdomain_config(struct pcmcia_device *link) |
134 | { | 131 | { |
135 | client_handle_t handle = link->handle; | ||
136 | scsi_info_t *info = link->priv; | 132 | scsi_info_t *info = link->priv; |
137 | tuple_t tuple; | 133 | tuple_t tuple; |
138 | cisparse_t parse; | 134 | cisparse_t parse; |
@@ -147,30 +143,30 @@ static void fdomain_config(dev_link_t *link) | |||
147 | tuple.TupleData = tuple_data; | 143 | tuple.TupleData = tuple_data; |
148 | tuple.TupleDataMax = 64; | 144 | tuple.TupleDataMax = 64; |
149 | tuple.TupleOffset = 0; | 145 | tuple.TupleOffset = 0; |
150 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); | 146 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |
151 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); | 147 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); |
152 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); | 148 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); |
153 | link->conf.ConfigBase = parse.config.base; | 149 | link->conf.ConfigBase = parse.config.base; |
154 | 150 | ||
155 | /* Configure card */ | 151 | /* Configure card */ |
156 | link->state |= DEV_CONFIG; | 152 | link->state |= DEV_CONFIG; |
157 | 153 | ||
158 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 154 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
159 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); | 155 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |
160 | while (1) { | 156 | while (1) { |
161 | if (pcmcia_get_tuple_data(handle, &tuple) != 0 || | 157 | if (pcmcia_get_tuple_data(link, &tuple) != 0 || |
162 | pcmcia_parse_tuple(handle, &tuple, &parse) != 0) | 158 | pcmcia_parse_tuple(link, &tuple, &parse) != 0) |
163 | goto next_entry; | 159 | goto next_entry; |
164 | link->conf.ConfigIndex = parse.cftable_entry.index; | 160 | link->conf.ConfigIndex = parse.cftable_entry.index; |
165 | link->io.BasePort1 = parse.cftable_entry.io.win[0].base; | 161 | link->io.BasePort1 = parse.cftable_entry.io.win[0].base; |
166 | i = pcmcia_request_io(handle, &link->io); | 162 | i = pcmcia_request_io(link, &link->io); |
167 | if (i == CS_SUCCESS) break; | 163 | if (i == CS_SUCCESS) break; |
168 | next_entry: | 164 | next_entry: |
169 | CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple)); | 165 | CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple)); |
170 | } | 166 | } |
171 | 167 | ||
172 | CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq)); | 168 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); |
173 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf)); | 169 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); |
174 | 170 | ||
175 | /* A bad hack... */ | 171 | /* A bad hack... */ |
176 | release_region(link->io.BasePort1, link->io.NumPorts1); | 172 | release_region(link->io.BasePort1, link->io.NumPorts1); |
@@ -196,7 +192,7 @@ static void fdomain_config(dev_link_t *link) | |||
196 | return; | 192 | return; |
197 | 193 | ||
198 | cs_failed: | 194 | cs_failed: |
199 | cs_error(link->handle, last_fn, last_ret); | 195 | cs_error(link, last_fn, last_ret); |
200 | fdomain_release(link); | 196 | fdomain_release(link); |
201 | return; | 197 | return; |
202 | 198 | ||
@@ -204,23 +200,21 @@ cs_failed: | |||
204 | 200 | ||
205 | /*====================================================================*/ | 201 | /*====================================================================*/ |
206 | 202 | ||
207 | static void fdomain_release(dev_link_t *link) | 203 | static void fdomain_release(struct pcmcia_device *link) |
208 | { | 204 | { |
209 | scsi_info_t *info = link->priv; | 205 | scsi_info_t *info = link->priv; |
210 | 206 | ||
211 | DEBUG(0, "fdomain_release(0x%p)\n", link); | 207 | DEBUG(0, "fdomain_release(0x%p)\n", link); |
212 | 208 | ||
213 | scsi_remove_host(info->host); | 209 | scsi_remove_host(info->host); |
214 | pcmcia_disable_device(link->handle); | 210 | pcmcia_disable_device(link); |
215 | scsi_unregister(info->host); | 211 | scsi_unregister(info->host); |
216 | } | 212 | } |
217 | 213 | ||
218 | /*====================================================================*/ | 214 | /*====================================================================*/ |
219 | 215 | ||
220 | static int fdomain_resume(struct pcmcia_device *dev) | 216 | static int fdomain_resume(struct pcmcia_device *link) |
221 | { | 217 | { |
222 | dev_link_t *link = dev_to_instance(dev); | ||
223 | |||
224 | if (link->state & DEV_CONFIG) | 218 | if (link->state & DEV_CONFIG) |
225 | fdomain_16x0_bus_reset(NULL); | 219 | fdomain_16x0_bus_reset(NULL); |
226 | 220 | ||