aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2008-08-03 04:56:13 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2008-08-22 20:29:42 -0400
commitd8b0a49da4f213c637d458319432016f4ea5e12a (patch)
tree488b1c1e8796f11807aaf7c18f9c5332c01a8e1e /drivers/pcmcia
parentde6405e9d1e7530ea33b62e1a3921338f836a046 (diff)
pcmcia: deprecate CS_BAD_VCC and CS_BAD_VPP
They were either used to report that changing voltage is not allowed, or that changing voltage failed. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r--drivers/pcmcia/ds.c3
-rw-r--r--drivers/pcmcia/pcmcia_resource.c29
2 files changed, 21 insertions, 11 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 4a658e2b6f21..f6ff1218b3f3 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -82,8 +82,7 @@ static const lookup_t error_table[] = {
82 { CS_BAD_PAGE, "Bad page number" }, 82 { CS_BAD_PAGE, "Bad page number" },
83 { CS_BAD_SIZE, "Bad size" }, 83 { CS_BAD_SIZE, "Bad size" },
84 { CS_BAD_TYPE, "Bad type" }, 84 { CS_BAD_TYPE, "Bad type" },
85 { CS_BAD_VCC, "Bad Vcc" }, 85 { -EIO, "Input/Output error" },
86 { CS_BAD_VPP, "Bad Vpp" },
87 { CS_NO_CARD, "No card present" }, 86 { CS_NO_CARD, "No card present" },
88 { -EINVAL, "Bad parameter" }, 87 { -EINVAL, "Bad parameter" },
89 { CS_GENERAL_FAILURE, "General failure" }, 88 { CS_GENERAL_FAILURE, "General failure" },
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index 3b8b0e14d8cf..9b61265fe7be 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -291,20 +291,28 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
291 s->ops->set_socket(s, &s->socket); 291 s->ops->set_socket(s, &s->socket);
292 } 292 }
293 293
294 if (mod->Attributes & CONF_VCC_CHANGE_VALID) 294 if (mod->Attributes & CONF_VCC_CHANGE_VALID) {
295 return CS_BAD_VCC; 295 ds_dbg(s, 0, "changing Vcc is not allowed at this time\n");
296 return -EINVAL;
297 }
296 298
297 /* We only allow changing Vpp1 and Vpp2 to the same value */ 299 /* We only allow changing Vpp1 and Vpp2 to the same value */
298 if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) && 300 if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) &&
299 (mod->Attributes & CONF_VPP2_CHANGE_VALID)) { 301 (mod->Attributes & CONF_VPP2_CHANGE_VALID)) {
300 if (mod->Vpp1 != mod->Vpp2) 302 if (mod->Vpp1 != mod->Vpp2)
301 return CS_BAD_VPP; 303 ds_dbg(s, 0, "Vpp1 and Vpp2 must be the same\n");
304 return -EINVAL;
302 s->socket.Vpp = mod->Vpp1; 305 s->socket.Vpp = mod->Vpp1;
303 if (s->ops->set_socket(s, &s->socket)) 306 if (s->ops->set_socket(s, &s->socket)) {
304 return CS_BAD_VPP; 307 dev_printk(KERN_WARNING, &s->dev,
308 "Unable to set VPP\n");
309 return -EIO;
310 }
305 } else if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) || 311 } else if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) ||
306 (mod->Attributes & CONF_VPP2_CHANGE_VALID)) 312 (mod->Attributes & CONF_VPP2_CHANGE_VALID)) {
307 return CS_BAD_VPP; 313 ds_dbg(s, 0, "changing Vcc is not allowed at this time\n");
314 return -EINVAL;
315 }
308 316
309 if (mod->Attributes & CONF_IO_CHANGE_WIDTH) { 317 if (mod->Attributes & CONF_IO_CHANGE_WIDTH) {
310 pccard_io_map io_off = { 0, 0, 0, 0, 1 }; 318 pccard_io_map io_off = { 0, 0, 0, 0, 1 };
@@ -485,8 +493,11 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev,
485 493
486 /* Do power control. We don't allow changes in Vcc. */ 494 /* Do power control. We don't allow changes in Vcc. */
487 s->socket.Vpp = req->Vpp; 495 s->socket.Vpp = req->Vpp;
488 if (s->ops->set_socket(s, &s->socket)) 496 if (s->ops->set_socket(s, &s->socket)) {
489 return CS_BAD_VPP; 497 dev_printk(KERN_WARNING, &s->dev,
498 "Unable to set socket state\n");
499 return -EINVAL;
500 }
490 501
491 /* Pick memory or I/O card, DMA mode, interrupt */ 502 /* Pick memory or I/O card, DMA mode, interrupt */
492 c->IntType = req->IntType; 503 c->IntType = req->IntType;