aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2008-08-03 06:10:53 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2008-08-22 20:29:56 -0400
commit69ba44331e81e4a15b504175ec70b7b4b4e5a8b9 (patch)
treecad7ae00519ff61d88f3766463c43119189d37b9 /drivers
parent610e23749e87920136e1a221266a43cb7e3823f1 (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')
-rw-r--r--drivers/pcmcia/ds.c4
-rw-r--r--drivers/pcmcia/pcmcia_ioctl.c5
-rw-r--r--drivers/pcmcia/pcmcia_resource.c24
3 files changed, 18 insertions, 15 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 4092a5976e62..3ccf4091e877 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -75,10 +75,6 @@ typedef struct lookup_t {
75 75
76static const lookup_t error_table[] = { 76static const lookup_t error_table[] = {
77 { 0, "Operation succeeded" }, 77 { 0, "Operation succeeded" },
78 { CS_BAD_BASE, "Bad base address" },
79 { CS_BAD_IRQ, "Bad IRQ" },
80 { CS_BAD_OFFSET, "Bad offset" },
81 { CS_BAD_SIZE, "Bad size" },
82 { -EIO, "Input/Output error" }, 78 { -EIO, "Input/Output error" },
83 { -ENODEV, "No card present" }, 79 { -ENODEV, "No card present" },
84 { -EINVAL, "Bad parameter" }, 80 { -EINVAL, "Bad parameter" },
diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c
index e27c71ebfda2..99563134ac0f 100644
--- a/drivers/pcmcia/pcmcia_ioctl.c
+++ b/drivers/pcmcia/pcmcia_ioctl.c
@@ -149,7 +149,7 @@ static int adjust_irq(struct pcmcia_socket *s, adjust_t *adj)
149 149
150 irq = adj->resource.irq.IRQ; 150 irq = adj->resource.irq.IRQ;
151 if ((irq < 0) || (irq > 15)) 151 if ((irq < 0) || (irq > 15))
152 return CS_BAD_IRQ; 152 return -EINVAL;
153 153
154 if (adj->Action != REMOVE_MANAGED_RESOURCE) 154 if (adj->Action != REMOVE_MANAGED_RESOURCE)
155 return 0; 155 return 0;
@@ -970,8 +970,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
970 case -ENOSYS: 970 case -ENOSYS:
971 err = ret; 971 err = ret;
972 break; 972 break;
973 case CS_BAD_ARGS: case CS_BAD_IRQ: 973 case CS_BAD_ARGS: case CS_BAD_TUPLE:
974 case CS_BAD_TUPLE:
975 err = -EINVAL; break; 974 err = -EINVAL; break;
976 case -ENOMEM: 975 case -ENOMEM:
977 err = -ENOSPC; break; 976 err = -ENOSPC; break;
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 */
264EXPORT_SYMBOL(pcmcia_map_mem_page); 266EXPORT_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