Skip to content

Commit 82f88e3

Browse files
author
Dominik Brodowski
committed
pcmcia: remove unused "window_t" typedef
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
1 parent d7b0364 commit 82f88e3

3 files changed

Lines changed: 33 additions & 37 deletions

File tree

‎drivers/pcmcia/pcmcia_ioctl.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ static int pcmcia_adjust_resource_info(adjust_t *adj)
224224
static int pcmcia_get_window(struct pcmcia_socket *s, window_handle_t *wh_out,
225225
window_handle_t wh, win_req_t *req)
226226
{
227-
window_t *win;
227+
pccard_mem_map *win;
228228
window_handle_t w;
229229

230230
wh--;
@@ -238,17 +238,17 @@ static int pcmcia_get_window(struct pcmcia_socket *s, window_handle_t *wh_out,
238238
if (w == MAX_WIN)
239239
return -EINVAL;
240240
win = &s->win[w];
241-
req->Base = win->ctl.res->start;
242-
req->Size = win->ctl.res->end - win->ctl.res->start + 1;
243-
req->AccessSpeed = win->ctl.speed;
241+
req->Base = win->res->start;
242+
req->Size = win->res->end - win->res->start + 1;
243+
req->AccessSpeed = win->speed;
244244
req->Attributes = 0;
245-
if (win->ctl.flags & MAP_ATTRIB)
245+
if (win->flags & MAP_ATTRIB)
246246
req->Attributes |= WIN_MEMORY_TYPE_AM;
247-
if (win->ctl.flags & MAP_ACTIVE)
247+
if (win->flags & MAP_ACTIVE)
248248
req->Attributes |= WIN_ENABLE;
249-
if (win->ctl.flags & MAP_16BIT)
249+
if (win->flags & MAP_16BIT)
250250
req->Attributes |= WIN_DATA_WIDTH_16;
251-
if (win->ctl.flags & MAP_USE_WAIT)
251+
if (win->flags & MAP_USE_WAIT)
252252
req->Attributes |= WIN_USE_WAIT;
253253

254254
*wh_out = w + 1;
@@ -268,7 +268,7 @@ static int pcmcia_get_mem_page(struct pcmcia_socket *skt, window_handle_t wh,
268268
return -EINVAL;
269269

270270
req->Page = 0;
271-
req->CardOffset = skt->win[wh].ctl.card_start;
271+
req->CardOffset = skt->win[wh].card_start;
272272
return 0;
273273
} /* pcmcia_get_mem_page */
274274

‎drivers/pcmcia/pcmcia_resource.c‎

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t wh,
197197
dev_dbg(&s->dev, "failure: requested page is zero\n");
198198
return -EINVAL;
199199
}
200-
s->win[wh].ctl.card_start = req->CardOffset;
201-
if (s->ops->set_mem_map(s, &s->win[wh].ctl) != 0) {
200+
s->win[wh].card_start = req->CardOffset;
201+
if (s->ops->set_mem_map(s, &s->win[wh]) != 0) {
202202
dev_dbg(&s->dev, "failed to set_mem_map\n");
203203
return -EIO;
204204
}
@@ -398,7 +398,7 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req)
398398
int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t wh)
399399
{
400400
struct pcmcia_socket *s = p_dev->socket;
401-
window_t *win;
401+
pccard_mem_map *win;
402402

403403
wh--;
404404
if (wh >= MAX_WIN)
@@ -412,15 +412,15 @@ int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t wh)
412412
}
413413

414414
/* Shut down memory window */
415-
win->ctl.flags &= ~MAP_ACTIVE;
416-
s->ops->set_mem_map(s, &win->ctl);
415+
win->flags &= ~MAP_ACTIVE;
416+
s->ops->set_mem_map(s, win);
417417
s->state &= ~SOCKET_WIN_REQ(wh);
418418

419419
/* Release system memory */
420-
if (win->ctl.res) {
421-
release_resource(win->ctl.res);
422-
kfree(win->ctl.res);
423-
win->ctl.res = NULL;
420+
if (win->res) {
421+
release_resource(win->res);
422+
kfree(win->res);
423+
win->res = NULL;
424424
}
425425
p_dev->_win &= ~CLIENT_WIN_REQ(wh);
426426

@@ -755,7 +755,7 @@ EXPORT_SYMBOL(pcmcia_request_irq);
755755
int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_handle_t *wh)
756756
{
757757
struct pcmcia_socket *s = (*p_dev)->socket;
758-
window_t *win;
758+
pccard_mem_map *win;
759759
u_long align;
760760
int w;
761761

@@ -797,39 +797,39 @@ int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_h
797797
win = &s->win[w];
798798

799799
if (!(s->features & SS_CAP_STATIC_MAP)) {
800-
win->ctl.res = pcmcia_find_mem_region(req->Base, req->Size, align,
800+
win->res = pcmcia_find_mem_region(req->Base, req->Size, align,
801801
(req->Attributes & WIN_MAP_BELOW_1MB), s);
802-
if (!win->ctl.res) {
802+
if (!win->res) {
803803
dev_dbg(&s->dev, "allocating mem region failed\n");
804804
return -EINVAL;
805805
}
806806
}
807807
(*p_dev)->_win |= CLIENT_WIN_REQ(w);
808808

809809
/* Configure the socket controller */
810-
win->ctl.map = w+1;
811-
win->ctl.flags = 0;
812-
win->ctl.speed = req->AccessSpeed;
810+
win->map = w+1;
811+
win->flags = 0;
812+
win->speed = req->AccessSpeed;
813813
if (req->Attributes & WIN_MEMORY_TYPE)
814-
win->ctl.flags |= MAP_ATTRIB;
814+
win->flags |= MAP_ATTRIB;
815815
if (req->Attributes & WIN_ENABLE)
816-
win->ctl.flags |= MAP_ACTIVE;
816+
win->flags |= MAP_ACTIVE;
817817
if (req->Attributes & WIN_DATA_WIDTH_16)
818-
win->ctl.flags |= MAP_16BIT;
818+
win->flags |= MAP_16BIT;
819819
if (req->Attributes & WIN_USE_WAIT)
820-
win->ctl.flags |= MAP_USE_WAIT;
821-
win->ctl.card_start = 0;
822-
if (s->ops->set_mem_map(s, &win->ctl) != 0) {
820+
win->flags |= MAP_USE_WAIT;
821+
win->card_start = 0;
822+
if (s->ops->set_mem_map(s, win) != 0) {
823823
dev_dbg(&s->dev, "failed to set memory mapping\n");
824824
return -EIO;
825825
}
826826
s->state |= SOCKET_WIN_REQ(w);
827827

828828
/* Return window handle */
829829
if (s->features & SS_CAP_STATIC_MAP) {
830-
req->Base = win->ctl.static_start;
830+
req->Base = win->static_start;
831831
} else {
832-
req->Base = win->ctl.res->start;
832+
req->Base = win->res->start;
833833
}
834834
*wh = w + 1;
835835

‎include/pcmcia/ss.h‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,6 @@ typedef struct io_window_t {
107107
struct resource *res;
108108
} io_window_t;
109109

110-
typedef struct window_t {
111-
pccard_mem_map ctl;
112-
} window_t;
113-
114110
/* Maximum number of IO windows per socket */
115111
#define MAX_IO_WIN 2
116112

@@ -150,7 +146,7 @@ struct pcmcia_socket {
150146
u_int Config;
151147
} irq;
152148
io_window_t io[MAX_IO_WIN];
153-
window_t win[MAX_WIN];
149+
pccard_mem_map win[MAX_WIN];
154150
struct list_head cis_cache;
155151
size_t fake_cis_len;
156152
u8 *fake_cis;

0 commit comments

Comments
 (0)