diff options
Diffstat (limited to 'drivers/mtd/maps/pcmciamtd.c')
-rw-r--r-- | drivers/mtd/maps/pcmciamtd.c | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c index 90924fb00481..d600c2deff73 100644 --- a/drivers/mtd/maps/pcmciamtd.c +++ b/drivers/mtd/maps/pcmciamtd.c | |||
@@ -118,7 +118,8 @@ static caddr_t remap_window(struct map_info *map, unsigned long to) | |||
118 | DEBUG(2, "Remapping window from 0x%8.8x to 0x%8.8x", | 118 | DEBUG(2, "Remapping window from 0x%8.8x to 0x%8.8x", |
119 | dev->offset, mrq.CardOffset); | 119 | dev->offset, mrq.CardOffset); |
120 | mrq.Page = 0; | 120 | mrq.Page = 0; |
121 | if( (ret = pcmcia_map_mem_page(win, &mrq)) != CS_SUCCESS) { | 121 | ret = pcmcia_map_mem_page(win, &mrq); |
122 | if (ret != 0) { | ||
122 | cs_error(dev->p_dev, MapMemPage, ret); | 123 | cs_error(dev->p_dev, MapMemPage, ret); |
123 | return NULL; | 124 | return NULL; |
124 | } | 125 | } |
@@ -326,9 +327,8 @@ static void pcmciamtd_set_vpp(struct map_info *map, int on) | |||
326 | 327 | ||
327 | DEBUG(2, "dev = %p on = %d vpp = %d\n", dev, on, dev->vpp); | 328 | DEBUG(2, "dev = %p on = %d vpp = %d\n", dev, on, dev->vpp); |
328 | ret = pcmcia_modify_configuration(link, &mod); | 329 | ret = pcmcia_modify_configuration(link, &mod); |
329 | if(ret != CS_SUCCESS) { | 330 | if (ret != 0) |
330 | cs_error(link, ModifyConfiguration, ret); | 331 | cs_error(link, ModifyConfiguration, ret); |
331 | } | ||
332 | } | 332 | } |
333 | 333 | ||
334 | 334 | ||
@@ -368,14 +368,14 @@ static void card_settings(struct pcmciamtd_dev *dev, struct pcmcia_device *link, | |||
368 | tuple.DesiredTuple = RETURN_FIRST_TUPLE; | 368 | tuple.DesiredTuple = RETURN_FIRST_TUPLE; |
369 | 369 | ||
370 | rc = pcmcia_get_first_tuple(link, &tuple); | 370 | rc = pcmcia_get_first_tuple(link, &tuple); |
371 | while(rc == CS_SUCCESS) { | 371 | while (rc == 0) { |
372 | rc = pcmcia_get_tuple_data(link, &tuple); | 372 | rc = pcmcia_get_tuple_data(link, &tuple); |
373 | if(rc != CS_SUCCESS) { | 373 | if (rc != 0) { |
374 | cs_error(link, GetTupleData, rc); | 374 | cs_error(link, GetTupleData, rc); |
375 | break; | 375 | break; |
376 | } | 376 | } |
377 | rc = pcmcia_parse_tuple(link, &tuple, &parse); | 377 | rc = pcmcia_parse_tuple(&tuple, &parse); |
378 | if(rc != CS_SUCCESS) { | 378 | if (rc != 0) { |
379 | cs_error(link, ParseTuple, rc); | 379 | cs_error(link, ParseTuple, rc); |
380 | break; | 380 | break; |
381 | } | 381 | } |
@@ -493,18 +493,11 @@ static int pcmciamtd_config(struct pcmcia_device *link) | |||
493 | int last_ret = 0, last_fn = 0; | 493 | int last_ret = 0, last_fn = 0; |
494 | int ret; | 494 | int ret; |
495 | int i; | 495 | int i; |
496 | config_info_t t; | ||
497 | static char *probes[] = { "jedec_probe", "cfi_probe" }; | 496 | static char *probes[] = { "jedec_probe", "cfi_probe" }; |
498 | int new_name = 0; | 497 | int new_name = 0; |
499 | 498 | ||
500 | DEBUG(3, "link=0x%p", link); | 499 | DEBUG(3, "link=0x%p", link); |
501 | 500 | ||
502 | DEBUG(2, "Validating CIS"); | ||
503 | ret = pcmcia_validate_cis(link, NULL); | ||
504 | if(ret != CS_SUCCESS) { | ||
505 | cs_error(link, GetTupleData, ret); | ||
506 | } | ||
507 | |||
508 | card_settings(dev, link, &new_name); | 501 | card_settings(dev, link, &new_name); |
509 | 502 | ||
510 | dev->pcmcia_map.phys = NO_XIP; | 503 | dev->pcmcia_map.phys = NO_XIP; |
@@ -571,10 +564,7 @@ static int pcmciamtd_config(struct pcmcia_device *link) | |||
571 | dev->pcmcia_map.map_priv_1 = (unsigned long)dev; | 564 | dev->pcmcia_map.map_priv_1 = (unsigned long)dev; |
572 | dev->pcmcia_map.map_priv_2 = (unsigned long)link->win; | 565 | dev->pcmcia_map.map_priv_2 = (unsigned long)link->win; |
573 | 566 | ||
574 | DEBUG(2, "Getting configuration"); | 567 | dev->vpp = (vpp) ? vpp : link->socket.socket.Vpp; |
575 | CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &t)); | ||
576 | DEBUG(2, "Vcc = %d Vpp1 = %d Vpp2 = %d", t.Vcc, t.Vpp1, t.Vpp2); | ||
577 | dev->vpp = (vpp) ? vpp : t.Vpp1; | ||
578 | link->conf.Attributes = 0; | 568 | link->conf.Attributes = 0; |
579 | if(setvpp == 2) { | 569 | if(setvpp == 2) { |
580 | link->conf.Vpp = dev->vpp; | 570 | link->conf.Vpp = dev->vpp; |
@@ -583,16 +573,10 @@ static int pcmciamtd_config(struct pcmcia_device *link) | |||
583 | } | 573 | } |
584 | 574 | ||
585 | link->conf.IntType = INT_MEMORY; | 575 | link->conf.IntType = INT_MEMORY; |
586 | link->conf.ConfigBase = t.ConfigBase; | ||
587 | link->conf.Status = t.Status; | ||
588 | link->conf.Pin = t.Pin; | ||
589 | link->conf.Copy = t.Copy; | ||
590 | link->conf.ExtStatus = t.ExtStatus; | ||
591 | link->conf.ConfigIndex = 0; | 576 | link->conf.ConfigIndex = 0; |
592 | link->conf.Present = t.Present; | ||
593 | DEBUG(2, "Setting Configuration"); | 577 | DEBUG(2, "Setting Configuration"); |
594 | ret = pcmcia_request_configuration(link, &link->conf); | 578 | ret = pcmcia_request_configuration(link, &link->conf); |
595 | if(ret != CS_SUCCESS) { | 579 | if (ret != 0) { |
596 | cs_error(link, RequestConfiguration, ret); | 580 | cs_error(link, RequestConfiguration, ret); |
597 | if (dev->win_base) { | 581 | if (dev->win_base) { |
598 | iounmap(dev->win_base); | 582 | iounmap(dev->win_base); |