diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2008-08-03 06:10:53 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2008-08-22 20:29:56 -0400 |
commit | 69ba44331e81e4a15b504175ec70b7b4b4e5a8b9 (patch) | |
tree | cad7ae00519ff61d88f3766463c43119189d37b9 /drivers/pcmcia/pcmcia_resource.c | |
parent | 610e23749e87920136e1a221266a43cb7e3823f1 (diff) |
pcmcia: deprecate CS_BAD_BASE, CS_BAD_IRQ, CS_BAD_OFFSET and CS_BAD_SIZE
These four error values mostly mean a badly written driver, so ds_dbg()
output and -EINVAL seems to be enough.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
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 | ||