serial_cs: fix serial_cs to support 3com 3C562 lan&modem multi-function pcmcia-card again. This code was deleted by Dominik(2006/12/05), but actually it is necessary for this card to get the correct configuration register information. Signed-off-by: Komuro <komurojun-mbn@xxxxxxxxx> --- --- linux-2.6.28-stock/drivers/serial/serial_cs.c.orig 2009-01-01 08:03:42.000000000 +0900 +++ linux-2.6.28-stock/drivers/serial/serial_cs.c 2009-01-01 09:55:37.000000000 +0900 @@ -681,7 +681,7 @@ static int serial_config(struct pcmcia_d u_char *buf; cisparse_t *parse; cistpl_cftable_entry_t *cf; - int i; + int i, last_ret, last_fn; DEBUG(0, "serial_config(0x%p)\n", link); @@ -699,6 +699,17 @@ static int serial_config(struct pcmcia_d tuple->TupleDataMax = 255; tuple->Attributes = 0; + /* Get configuration register information */ + tuple->DesiredTuple = CISTPL_CONFIG; + last_ret = first_tuple(link, tuple, parse); + if (last_ret != 0) { + last_fn = ParseTuple; + goto cs_failed; + } + link->conf.ConfigBase = parse->config.base; + link->conf.Present = parse->config.rmask[0]; + + /* Is this a compliant multifunction card? */ tuple->DesiredTuple = CISTPL_LONGLINK_MFC; tuple->Attributes = TUPLE_RETURN_COMMON | TUPLE_RETURN_LINK; @@ -761,7 +772,9 @@ static int serial_config(struct pcmcia_d kfree(cfg_mem); return 0; - failed: +cs_failed: + cs_error(link, last_fn, last_ret); +failed: serial_remove(link); kfree(cfg_mem); return -ENODEV; -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html