static const lookup_t error_table[] = {
{ 0, "Operation succeeded" },
- { CS_BAD_BASE, "Bad base address" },
- { CS_BAD_IRQ, "Bad IRQ" },
- { CS_BAD_OFFSET, "Bad offset" },
- { CS_BAD_SIZE, "Bad size" },
{ -EIO, "Input/Output error" },
{ -ENODEV, "No card present" },
{ -EINVAL, "Bad parameter" },
irq = adj->resource.irq.IRQ;
if ((irq < 0) || (irq > 15))
- return CS_BAD_IRQ;
+ return -EINVAL;
if (adj->Action != REMOVE_MANAGED_RESOURCE)
return 0;
case -ENOSYS:
err = ret;
break;
- case CS_BAD_ARGS: case CS_BAD_IRQ:
- case CS_BAD_TUPLE:
+ case CS_BAD_ARGS: case CS_BAD_TUPLE:
err = -EINVAL; break;
case -ENOMEM:
err = -ENOSPC; break;
return -EINVAL;
}
win->ctl.card_start = req->CardOffset;
- if (s->ops->set_mem_map(s, &win->ctl) != 0)
- return CS_BAD_OFFSET;
+ if (s->ops->set_mem_map(s, &win->ctl) != 0) {
+ ds_dbg(s, 0, "failed to set_mem_map\n");
+ return -EIO;
+ }
return 0;
} /* pcmcia_map_mem_page */
EXPORT_SYMBOL(pcmcia_map_mem_page);
ds_dbg(s, 0, "IRQ attributes must match assigned ones\n");
return -EINVAL;
}
- if (s->irq.AssignedIRQ != req->AssignedIRQ)
- return CS_BAD_IRQ;
+ if (s->irq.AssignedIRQ != req->AssignedIRQ) {
+ ds_dbg(s, 0, "IRQ must match assigned one\n");
+ return -EINVAL;
+ }
if (--s->irq.Config == 0) {
c->state &= ~CONFIG_IRQ_REQ;
s->irq.AssignedIRQ = 0;
align = (((s->features & SS_CAP_MEM_ALIGN) ||
(req->Attributes & WIN_STRICT_ALIGN)) ?
req->Size : s->map_size);
- if (req->Size & (s->map_size-1))
- return CS_BAD_SIZE;
+ if (req->Size & (s->map_size-1)) {
+ ds_dbg(s, 0, "invalid map size\n");
+ return -EINVAL;
+ }
if ((req->Base && (s->features & SS_CAP_STATIC_MAP)) ||
- (req->Base & (align-1)))
- return CS_BAD_BASE;
+ (req->Base & (align-1))) {
+ ds_dbg(s, 0, "invalid base address\n");
+ return -EINVAL;
+ }
if (req->Base)
align = 0;
#define CS_SUCCESS 0x00
#define CS_BAD_ADAPTER -ENODEV
#define CS_BAD_ATTRIBUTE -EINVAL
-#define CS_BAD_BASE 0x03
+#define CS_BAD_BASE -EINVAL
#define CS_BAD_EDC -ENODEV
-#define CS_BAD_IRQ 0x06
-#define CS_BAD_OFFSET 0x07
+#define CS_BAD_IRQ -EINVAL
+#define CS_BAD_OFFSET -EIO
#define CS_BAD_PAGE -EINVAL
#define CS_READ_FAILURE -EIO
-#define CS_BAD_SIZE 0x0a
+#define CS_BAD_SIZE -EINVAL
#define CS_BAD_SOCKET -EINVAL
#define CS_BAD_TYPE -EINVAL
#define CS_BAD_VCC -EINVAL