X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=drivers%2Fserial%2Fserial_cs.c;h=7546aa887fa7565417fe3a9f14956f5e9e314e40;hb=9e41d9597e7825ec20d690013d32bcec5f3fe16a;hp=f8658686439df9bf0aded55b944c9cd76452b90d;hpb=8e2fc39ddea7fe8c6798837da282db88a09af793;p=linux-2.6-omap-h63xx.git diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c index f8658686439..7546aa887fa 100644 --- a/drivers/serial/serial_cs.c +++ b/drivers/serial/serial_cs.c @@ -431,12 +431,12 @@ first_tuple(struct pcmcia_device *handle, tuple_t * tuple, cisparse_t * parse) { int i; i = pcmcia_get_first_tuple(handle, tuple); - if (i != CS_SUCCESS) - return CS_NO_MORE_ITEMS; + if (i != 0) + return i; i = pcmcia_get_tuple_data(handle, tuple); - if (i != CS_SUCCESS) + if (i != 0) return i; - return pcmcia_parse_tuple(handle, tuple, parse); + return pcmcia_parse_tuple(tuple, parse); } /*====================================================================*/ @@ -444,6 +444,7 @@ first_tuple(struct pcmcia_device *handle, tuple_t * tuple, cisparse_t * parse) static int simple_config_check(struct pcmcia_device *p_dev, cistpl_cftable_entry_t *cf, cistpl_cftable_entry_t *dflt, + unsigned int vcc, void *priv_data) { static const int size_table[2] = { 8, 16 }; @@ -467,6 +468,7 @@ static int simple_config_check(struct pcmcia_device *p_dev, static int simple_config_check_notpicky(struct pcmcia_device *p_dev, cistpl_cftable_entry_t *cf, cistpl_cftable_entry_t *dflt, + unsigned int vcc, void *priv_data) { static const unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; @@ -486,23 +488,23 @@ static int simple_config_check_notpicky(struct pcmcia_device *p_dev, static int simple_config(struct pcmcia_device *link) { struct serial_info *info = link->priv; - config_info_t config; - int i, try; + int i = -ENODEV, try; /* If the card is already configured, look up the port and irq */ - i = pcmcia_get_configuration_info(link, &config); - if ((i == CS_SUCCESS) && (config.Attributes & CONF_VALID_CLIENT)) { + if (link->function_config) { unsigned int port = 0; - if ((config.BasePort2 != 0) && (config.NumPorts2 == 8)) { - port = config.BasePort2; + if ((link->io.BasePort2 != 0) && + (link->io.NumPorts2 == 8)) { + port = link->io.BasePort2; info->slave = 1; } else if ((info->manfid == MANFID_OSITECH) && - (config.NumPorts1 == 0x40)) { - port = config.BasePort1 + 0x28; + (link->io.NumPorts1 == 0x40)) { + port = link->io.BasePort1 + 0x28; info->slave = 1; } if (info->slave) { - return setup_serial(link, info, port, config.AssignedIRQ); + return setup_serial(link, info, port, + link->irq.AssignedIRQ); } } @@ -525,7 +527,7 @@ static int simple_config(struct pcmcia_device *link) found_port: i = pcmcia_request_irq(link, &link->irq); - if (i != CS_SUCCESS) { + if (i != 0) { cs_error(link, RequestIRQ, i); link->irq.AssignedIRQ = 0; } @@ -539,7 +541,7 @@ found_port: info->quirk->config(link); i = pcmcia_request_configuration(link, &link->conf); - if (i != CS_SUCCESS) { + if (i != 0) { cs_error(link, RequestConfiguration, i); return -1; } @@ -549,6 +551,7 @@ found_port: static int multi_config_check(struct pcmcia_device *p_dev, cistpl_cftable_entry_t *cf, cistpl_cftable_entry_t *dflt, + unsigned int vcc, void *priv_data) { int *base2 = priv_data; @@ -569,6 +572,7 @@ static int multi_config_check(struct pcmcia_device *p_dev, static int multi_config_check_notpicky(struct pcmcia_device *p_dev, cistpl_cftable_entry_t *cf, cistpl_cftable_entry_t *dflt, + unsigned int vcc, void *priv_data) { int *base2 = priv_data; @@ -605,7 +609,7 @@ static int multi_config(struct pcmcia_device *link) } i = pcmcia_request_irq(link, &link->irq); - if (i != CS_SUCCESS) { + if (i != 0) { /* FIXME: comment does not fit, error handling does not fit */ printk(KERN_NOTICE "serial_cs: no usable port range found, giving up\n"); @@ -620,7 +624,7 @@ static int multi_config(struct pcmcia_device *link) info->quirk->config(link); i = pcmcia_request_configuration(link, &link->conf); - if (i != CS_SUCCESS) { + if (i != 0) { cs_error(link, RequestConfiguration, i); return -ENODEV; } @@ -698,7 +702,7 @@ static int serial_config(struct pcmcia_device * link) /* Is this a compliant multifunction card? */ tuple->DesiredTuple = CISTPL_LONGLINK_MFC; tuple->Attributes = TUPLE_RETURN_COMMON | TUPLE_RETURN_LINK; - info->multi = (first_tuple(link, tuple, parse) == CS_SUCCESS); + info->multi = (first_tuple(link, tuple, parse) == 0); /* Is this a multiport card? */ tuple->DesiredTuple = CISTPL_MANFID; @@ -722,7 +726,7 @@ static int serial_config(struct pcmcia_device * link) ((link->func_id == CISTPL_FUNCID_MULTI) || (link->func_id == CISTPL_FUNCID_SERIAL))) { tuple->DesiredTuple = CISTPL_CFTABLE_ENTRY; - if (first_tuple(link, tuple, parse) == CS_SUCCESS) { + if (first_tuple(link, tuple, parse) == 0) { if ((cf->io.nwin == 1) && (cf->io.win[0].len % 8 == 0)) info->multi = cf->io.win[0].len >> 3; if ((cf->io.nwin == 2) && (cf->io.win[0].len == 8) &&