diff options
Diffstat (limited to 'drivers/pcmcia/pcmcia_resource.c')
-rw-r--r-- | drivers/pcmcia/pcmcia_resource.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index 35a61577ae4e..fee57139a96f 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c | |||
@@ -257,8 +257,10 @@ int pcmcia_map_mem_page(window_handle_t win, memreq_t *req) | |||
257 | return -EINVAL; | 257 | return -EINVAL; |
258 | } | 258 | } |
259 | win->ctl.card_start = req->CardOffset; | 259 | win->ctl.card_start = req->CardOffset; |
260 | if (s->ops->set_mem_map(s, &win->ctl) != 0) | 260 | if (s->ops->set_mem_map(s, &win->ctl) != 0) { |
261 | return CS_BAD_OFFSET; | 261 | ds_dbg(s, 0, "failed to set_mem_map\n"); |
262 | return -EIO; | ||
263 | } | ||
262 | return 0; | 264 | return 0; |
263 | } /* pcmcia_map_mem_page */ | 265 | } /* pcmcia_map_mem_page */ |
264 | EXPORT_SYMBOL(pcmcia_map_mem_page); | 266 | EXPORT_SYMBOL(pcmcia_map_mem_page); |
@@ -426,8 +428,10 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req) | |||
426 | ds_dbg(s, 0, "IRQ attributes must match assigned ones\n"); | 428 | ds_dbg(s, 0, "IRQ attributes must match assigned ones\n"); |
427 | return -EINVAL; | 429 | return -EINVAL; |
428 | } | 430 | } |
429 | if (s->irq.AssignedIRQ != req->AssignedIRQ) | 431 | if (s->irq.AssignedIRQ != req->AssignedIRQ) { |
430 | return CS_BAD_IRQ; | 432 | ds_dbg(s, 0, "IRQ must match assigned one\n"); |
433 | return -EINVAL; | ||
434 | } | ||
431 | if (--s->irq.Config == 0) { | 435 | if (--s->irq.Config == 0) { |
432 | c->state &= ~CONFIG_IRQ_REQ; | 436 | c->state &= ~CONFIG_IRQ_REQ; |
433 | s->irq.AssignedIRQ = 0; | 437 | s->irq.AssignedIRQ = 0; |
@@ -802,11 +806,15 @@ int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_h | |||
802 | align = (((s->features & SS_CAP_MEM_ALIGN) || | 806 | align = (((s->features & SS_CAP_MEM_ALIGN) || |
803 | (req->Attributes & WIN_STRICT_ALIGN)) ? | 807 | (req->Attributes & WIN_STRICT_ALIGN)) ? |
804 | req->Size : s->map_size); | 808 | req->Size : s->map_size); |
805 | if (req->Size & (s->map_size-1)) | 809 | if (req->Size & (s->map_size-1)) { |
806 | return CS_BAD_SIZE; | 810 | ds_dbg(s, 0, "invalid map size\n"); |
811 | return -EINVAL; | ||
812 | } | ||
807 | if ((req->Base && (s->features & SS_CAP_STATIC_MAP)) || | 813 | if ((req->Base && (s->features & SS_CAP_STATIC_MAP)) || |
808 | (req->Base & (align-1))) | 814 | (req->Base & (align-1))) { |
809 | return CS_BAD_BASE; | 815 | ds_dbg(s, 0, "invalid base address\n"); |
816 | return -EINVAL; | ||
817 | } | ||
810 | if (req->Base) | 818 | if (req->Base) |
811 | align = 0; | 819 | align = 0; |
812 | 820 | ||