diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2009-10-24 09:55:39 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2009-11-09 02:30:05 -0500 |
commit | 9b44de2015ff4a2ed1d56efedfcc72b917d356a6 (patch) | |
tree | 63460e0cf95d4bbea0111d153247c3298ac4ff3d /drivers/mtd/maps/pcmciamtd.c | |
parent | 7c5af6ffd69bb2bb3c86b374153627529d67598c (diff) |
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (misc drivers)
Convert PCMCIA drivers to use the dynamic debug infrastructure, instead of
requiring manual settings of PCMCIA_DEBUG.
Also, remove all usages of the CS_CHECK macro and replace them with proper
Linux style calling and return value checking. The extra error reporting may
be dropped, as the PCMCIA core already complains about any (non-driver-author)
errors.
CC: linux-mtd@lists.infradead.org
CC: linux-usb@vger.kernel.org
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/mtd/maps/pcmciamtd.c')
-rw-r--r-- | drivers/mtd/maps/pcmciamtd.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c index 5c3546ef29dc..b698dbaaf9e6 100644 --- a/drivers/mtd/maps/pcmciamtd.c +++ b/drivers/mtd/maps/pcmciamtd.c | |||
@@ -119,10 +119,8 @@ static caddr_t remap_window(struct map_info *map, unsigned long to) | |||
119 | dev->offset, mrq.CardOffset); | 119 | dev->offset, mrq.CardOffset); |
120 | mrq.Page = 0; | 120 | mrq.Page = 0; |
121 | ret = pcmcia_map_mem_page(win, &mrq); | 121 | ret = pcmcia_map_mem_page(win, &mrq); |
122 | if (ret != 0) { | 122 | if (ret != 0) |
123 | cs_error(dev->p_dev, MapMemPage, ret); | ||
124 | return NULL; | 123 | return NULL; |
125 | } | ||
126 | dev->offset = mrq.CardOffset; | 124 | dev->offset = mrq.CardOffset; |
127 | } | 125 | } |
128 | return dev->win_base + (to & (dev->win_size-1)); | 126 | return dev->win_base + (to & (dev->win_size-1)); |
@@ -327,8 +325,6 @@ static void pcmciamtd_set_vpp(struct map_info *map, int on) | |||
327 | 325 | ||
328 | DEBUG(2, "dev = %p on = %d vpp = %d\n", dev, on, dev->vpp); | 326 | DEBUG(2, "dev = %p on = %d vpp = %d\n", dev, on, dev->vpp); |
329 | ret = pcmcia_modify_configuration(link, &mod); | 327 | ret = pcmcia_modify_configuration(link, &mod); |
330 | if (ret != 0) | ||
331 | cs_error(link, ModifyConfiguration, ret); | ||
332 | } | 328 | } |
333 | 329 | ||
334 | 330 | ||
@@ -490,16 +486,12 @@ static void card_settings(struct pcmciamtd_dev *dev, struct pcmcia_device *link, | |||
490 | * MTD device available to the system. | 486 | * MTD device available to the system. |
491 | */ | 487 | */ |
492 | 488 | ||
493 | #define CS_CHECK(fn, ret) \ | ||
494 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | ||
495 | |||
496 | static int pcmciamtd_config(struct pcmcia_device *link) | 489 | static int pcmciamtd_config(struct pcmcia_device *link) |
497 | { | 490 | { |
498 | struct pcmciamtd_dev *dev = link->priv; | 491 | struct pcmciamtd_dev *dev = link->priv; |
499 | struct mtd_info *mtd = NULL; | 492 | struct mtd_info *mtd = NULL; |
500 | cs_status_t status; | 493 | cs_status_t status; |
501 | win_req_t req; | 494 | win_req_t req; |
502 | int last_ret = 0, last_fn = 0; | ||
503 | int ret; | 495 | int ret; |
504 | int i; | 496 | int i; |
505 | static char *probes[] = { "jedec_probe", "cfi_probe" }; | 497 | static char *probes[] = { "jedec_probe", "cfi_probe" }; |
@@ -586,7 +578,6 @@ static int pcmciamtd_config(struct pcmcia_device *link) | |||
586 | DEBUG(2, "Setting Configuration"); | 578 | DEBUG(2, "Setting Configuration"); |
587 | ret = pcmcia_request_configuration(link, &link->conf); | 579 | ret = pcmcia_request_configuration(link, &link->conf); |
588 | if (ret != 0) { | 580 | if (ret != 0) { |
589 | cs_error(link, RequestConfiguration, ret); | ||
590 | if (dev->win_base) { | 581 | if (dev->win_base) { |
591 | iounmap(dev->win_base); | 582 | iounmap(dev->win_base); |
592 | dev->win_base = NULL; | 583 | dev->win_base = NULL; |
@@ -661,8 +652,7 @@ static int pcmciamtd_config(struct pcmcia_device *link) | |||
661 | link->dev_node = &dev->node; | 652 | link->dev_node = &dev->node; |
662 | return 0; | 653 | return 0; |
663 | 654 | ||
664 | cs_failed: | 655 | failed: |
665 | cs_error(link, last_fn, last_ret); | ||
666 | err("CS Error, exiting"); | 656 | err("CS Error, exiting"); |
667 | pcmciamtd_release(link); | 657 | pcmciamtd_release(link); |
668 | return -ENODEV; | 658 | return -ENODEV; |