diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2008-08-03 10:56:13 +0200 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2008-08-23 02:29:42 +0200 |
commit | d8b0a49da4f213c637d458319432016f4ea5e12a (patch) | |
tree | 488b1c1e8796f11807aaf7c18f9c5332c01a8e1e /drivers | |
parent | de6405e9d1e7530ea33b62e1a3921338f836a046 (diff) | |
download | linux-d8b0a49da4f213c637d458319432016f4ea5e12a.tar.bz2 |
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')
-rw-r--r-- | drivers/pcmcia/ds.c | 3 | ||||
-rw-r--r-- | drivers/pcmcia/pcmcia_resource.c | 29 |
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[] = { { CS_BAD_PAGE, "Bad page number" }, { CS_BAD_SIZE, "Bad size" }, { CS_BAD_TYPE, "Bad type" }, - { CS_BAD_VCC, "Bad Vcc" }, - { CS_BAD_VPP, "Bad Vpp" }, + { -EIO, "Input/Output error" }, { CS_NO_CARD, "No card present" }, { -EINVAL, "Bad parameter" }, { 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, s->ops->set_socket(s, &s->socket); } - if (mod->Attributes & CONF_VCC_CHANGE_VALID) - return CS_BAD_VCC; + if (mod->Attributes & CONF_VCC_CHANGE_VALID) { + ds_dbg(s, 0, "changing Vcc is not allowed at this time\n"); + return -EINVAL; + } /* We only allow changing Vpp1 and Vpp2 to the same value */ if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) && (mod->Attributes & CONF_VPP2_CHANGE_VALID)) { if (mod->Vpp1 != mod->Vpp2) - return CS_BAD_VPP; + ds_dbg(s, 0, "Vpp1 and Vpp2 must be the same\n"); + return -EINVAL; s->socket.Vpp = mod->Vpp1; - if (s->ops->set_socket(s, &s->socket)) - return CS_BAD_VPP; + if (s->ops->set_socket(s, &s->socket)) { + dev_printk(KERN_WARNING, &s->dev, + "Unable to set VPP\n"); + return -EIO; + } } else if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) || - (mod->Attributes & CONF_VPP2_CHANGE_VALID)) - return CS_BAD_VPP; + (mod->Attributes & CONF_VPP2_CHANGE_VALID)) { + ds_dbg(s, 0, "changing Vcc is not allowed at this time\n"); + return -EINVAL; + } if (mod->Attributes & CONF_IO_CHANGE_WIDTH) { pccard_io_map io_off = { 0, 0, 0, 0, 1 }; @@ -485,8 +493,11 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev, /* Do power control. We don't allow changes in Vcc. */ s->socket.Vpp = req->Vpp; - if (s->ops->set_socket(s, &s->socket)) - return CS_BAD_VPP; + if (s->ops->set_socket(s, &s->socket)) { + dev_printk(KERN_WARNING, &s->dev, + "Unable to set socket state\n"); + return -EINVAL; + } /* Pick memory or I/O card, DMA mode, interrupt */ c->IntType = req->IntType; |