diff options
| author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:26:06 -0500 |
|---|---|---|
| committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:26:06 -0500 |
| commit | 15b99ac1729503db9e6dc642a50b9b6cb3bf51f9 (patch) | |
| tree | cfb8897487beba502aac2b28bc35066a87e34299 | |
| parent | fba395eee7d3f342ca739c20f5b3ee635d0420a0 (diff) | |
[PATCH] pcmcia: add return value to _config() functions
Most of the driver initialization isn't done in the .probe function, but in
the internal _config() functions. Make them return a value, so that .probe
can properly report whether the probing of the device succeeded or not.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
45 files changed, 379 insertions, 404 deletions
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c index e557f2359ccc..50174fb107a8 100644 --- a/drivers/bluetooth/bluecard_cs.c +++ b/drivers/bluetooth/bluecard_cs.c | |||
| @@ -85,7 +85,7 @@ typedef struct bluecard_info_t { | |||
| 85 | } bluecard_info_t; | 85 | } bluecard_info_t; |
| 86 | 86 | ||
| 87 | 87 | ||
| 88 | static void bluecard_config(struct pcmcia_device *link); | 88 | static int bluecard_config(struct pcmcia_device *link); |
| 89 | static void bluecard_release(struct pcmcia_device *link); | 89 | static void bluecard_release(struct pcmcia_device *link); |
| 90 | 90 | ||
| 91 | static void bluecard_detach(struct pcmcia_device *p_dev); | 91 | static void bluecard_detach(struct pcmcia_device *p_dev); |
| @@ -856,7 +856,7 @@ static int bluecard_close(bluecard_info_t *info) | |||
| 856 | return 0; | 856 | return 0; |
| 857 | } | 857 | } |
| 858 | 858 | ||
| 859 | static int bluecard_attach(struct pcmcia_device *link) | 859 | static int bluecard_probe(struct pcmcia_device *link) |
| 860 | { | 860 | { |
| 861 | bluecard_info_t *info; | 861 | bluecard_info_t *info; |
| 862 | 862 | ||
| @@ -880,9 +880,7 @@ static int bluecard_attach(struct pcmcia_device *link) | |||
| 880 | link->conf.IntType = INT_MEMORY_AND_IO; | 880 | link->conf.IntType = INT_MEMORY_AND_IO; |
| 881 | 881 | ||
| 882 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 882 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 883 | bluecard_config(link); | 883 | return bluecard_config(link); |
| 884 | |||
| 885 | return 0; | ||
| 886 | } | 884 | } |
| 887 | 885 | ||
| 888 | 886 | ||
| @@ -912,7 +910,7 @@ static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t | |||
| 912 | return pcmcia_parse_tuple(handle, tuple, parse); | 910 | return pcmcia_parse_tuple(handle, tuple, parse); |
| 913 | } | 911 | } |
| 914 | 912 | ||
| 915 | static void bluecard_config(struct pcmcia_device *link) | 913 | static int bluecard_config(struct pcmcia_device *link) |
| 916 | { | 914 | { |
| 917 | bluecard_info_t *info = link->priv; | 915 | bluecard_info_t *info = link->priv; |
| 918 | tuple_t tuple; | 916 | tuple_t tuple; |
| @@ -973,13 +971,14 @@ static void bluecard_config(struct pcmcia_device *link) | |||
| 973 | link->dev_node = &info->node; | 971 | link->dev_node = &info->node; |
| 974 | link->state &= ~DEV_CONFIG_PENDING; | 972 | link->state &= ~DEV_CONFIG_PENDING; |
| 975 | 973 | ||
| 976 | return; | 974 | return 0; |
| 977 | 975 | ||
| 978 | cs_failed: | 976 | cs_failed: |
| 979 | cs_error(link, last_fn, last_ret); | 977 | cs_error(link, last_fn, last_ret); |
| 980 | 978 | ||
| 981 | failed: | 979 | failed: |
| 982 | bluecard_release(link); | 980 | bluecard_release(link); |
| 981 | return -ENODEV; | ||
| 983 | } | 982 | } |
| 984 | 983 | ||
| 985 | 984 | ||
| @@ -1008,7 +1007,7 @@ static struct pcmcia_driver bluecard_driver = { | |||
| 1008 | .drv = { | 1007 | .drv = { |
| 1009 | .name = "bluecard_cs", | 1008 | .name = "bluecard_cs", |
| 1010 | }, | 1009 | }, |
| 1011 | .probe = bluecard_attach, | 1010 | .probe = bluecard_probe, |
| 1012 | .remove = bluecard_detach, | 1011 | .remove = bluecard_detach, |
| 1013 | .id_table = bluecard_ids, | 1012 | .id_table = bluecard_ids, |
| 1014 | }; | 1013 | }; |
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c index 7ea8fa350d26..80861f4f35e3 100644 --- a/drivers/bluetooth/bt3c_cs.c +++ b/drivers/bluetooth/bt3c_cs.c | |||
| @@ -88,7 +88,7 @@ typedef struct bt3c_info_t { | |||
| 88 | } bt3c_info_t; | 88 | } bt3c_info_t; |
| 89 | 89 | ||
| 90 | 90 | ||
| 91 | static void bt3c_config(struct pcmcia_device *link); | 91 | static int bt3c_config(struct pcmcia_device *link); |
| 92 | static void bt3c_release(struct pcmcia_device *link); | 92 | static void bt3c_release(struct pcmcia_device *link); |
| 93 | 93 | ||
| 94 | static void bt3c_detach(struct pcmcia_device *p_dev); | 94 | static void bt3c_detach(struct pcmcia_device *p_dev); |
| @@ -645,7 +645,7 @@ static int bt3c_close(bt3c_info_t *info) | |||
| 645 | return 0; | 645 | return 0; |
| 646 | } | 646 | } |
| 647 | 647 | ||
| 648 | static int bt3c_attach(struct pcmcia_device *link) | 648 | static int bt3c_probe(struct pcmcia_device *link) |
| 649 | { | 649 | { |
| 650 | bt3c_info_t *info; | 650 | bt3c_info_t *info; |
| 651 | 651 | ||
| @@ -669,9 +669,7 @@ static int bt3c_attach(struct pcmcia_device *link) | |||
| 669 | link->conf.IntType = INT_MEMORY_AND_IO; | 669 | link->conf.IntType = INT_MEMORY_AND_IO; |
| 670 | 670 | ||
| 671 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 671 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 672 | bt3c_config(link); | 672 | return bt3c_config(link); |
| 673 | |||
| 674 | return 0; | ||
| 675 | } | 673 | } |
| 676 | 674 | ||
| 677 | 675 | ||
| @@ -710,7 +708,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t * | |||
| 710 | return get_tuple(handle, tuple, parse); | 708 | return get_tuple(handle, tuple, parse); |
| 711 | } | 709 | } |
| 712 | 710 | ||
| 713 | static void bt3c_config(struct pcmcia_device *link) | 711 | static int bt3c_config(struct pcmcia_device *link) |
| 714 | { | 712 | { |
| 715 | static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; | 713 | static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; |
| 716 | bt3c_info_t *info = link->priv; | 714 | bt3c_info_t *info = link->priv; |
| @@ -809,13 +807,14 @@ found_port: | |||
| 809 | link->dev_node = &info->node; | 807 | link->dev_node = &info->node; |
| 810 | link->state &= ~DEV_CONFIG_PENDING; | 808 | link->state &= ~DEV_CONFIG_PENDING; |
| 811 | 809 | ||
| 812 | return; | 810 | return 0; |
| 813 | 811 | ||
| 814 | cs_failed: | 812 | cs_failed: |
| 815 | cs_error(link, last_fn, last_ret); | 813 | cs_error(link, last_fn, last_ret); |
| 816 | 814 | ||
| 817 | failed: | 815 | failed: |
| 818 | bt3c_release(link); | 816 | bt3c_release(link); |
| 817 | return -ENODEV; | ||
| 819 | } | 818 | } |
| 820 | 819 | ||
| 821 | 820 | ||
| @@ -841,7 +840,7 @@ static struct pcmcia_driver bt3c_driver = { | |||
| 841 | .drv = { | 840 | .drv = { |
| 842 | .name = "bt3c_cs", | 841 | .name = "bt3c_cs", |
| 843 | }, | 842 | }, |
| 844 | .probe = bt3c_attach, | 843 | .probe = bt3c_probe, |
| 845 | .remove = bt3c_detach, | 844 | .remove = bt3c_detach, |
| 846 | .id_table = bt3c_ids, | 845 | .id_table = bt3c_ids, |
| 847 | }; | 846 | }; |
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c index 594839061360..658a1373699e 100644 --- a/drivers/bluetooth/btuart_cs.c +++ b/drivers/bluetooth/btuart_cs.c | |||
| @@ -84,7 +84,7 @@ typedef struct btuart_info_t { | |||
| 84 | } btuart_info_t; | 84 | } btuart_info_t; |
| 85 | 85 | ||
| 86 | 86 | ||
| 87 | static void btuart_config(struct pcmcia_device *link); | 87 | static int btuart_config(struct pcmcia_device *link); |
| 88 | static void btuart_release(struct pcmcia_device *link); | 88 | static void btuart_release(struct pcmcia_device *link); |
| 89 | 89 | ||
| 90 | static void btuart_detach(struct pcmcia_device *p_dev); | 90 | static void btuart_detach(struct pcmcia_device *p_dev); |
| @@ -576,7 +576,7 @@ static int btuart_close(btuart_info_t *info) | |||
| 576 | return 0; | 576 | return 0; |
| 577 | } | 577 | } |
| 578 | 578 | ||
| 579 | static int btuart_attach(struct pcmcia_device *link) | 579 | static int btuart_probe(struct pcmcia_device *link) |
| 580 | { | 580 | { |
| 581 | btuart_info_t *info; | 581 | btuart_info_t *info; |
| 582 | 582 | ||
| @@ -600,9 +600,7 @@ static int btuart_attach(struct pcmcia_device *link) | |||
| 600 | link->conf.IntType = INT_MEMORY_AND_IO; | 600 | link->conf.IntType = INT_MEMORY_AND_IO; |
| 601 | 601 | ||
| 602 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 602 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 603 | btuart_config(link); | 603 | return btuart_config(link); |
| 604 | |||
| 605 | return 0; | ||
| 606 | } | 604 | } |
| 607 | 605 | ||
| 608 | 606 | ||
| @@ -641,7 +639,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t * | |||
| 641 | return get_tuple(handle, tuple, parse); | 639 | return get_tuple(handle, tuple, parse); |
| 642 | } | 640 | } |
| 643 | 641 | ||
| 644 | static void btuart_config(struct pcmcia_device *link) | 642 | static int btuart_config(struct pcmcia_device *link) |
| 645 | { | 643 | { |
| 646 | static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; | 644 | static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; |
| 647 | btuart_info_t *info = link->priv; | 645 | btuart_info_t *info = link->priv; |
| @@ -741,13 +739,14 @@ found_port: | |||
| 741 | link->dev_node = &info->node; | 739 | link->dev_node = &info->node; |
| 742 | link->state &= ~DEV_CONFIG_PENDING; | 740 | link->state &= ~DEV_CONFIG_PENDING; |
| 743 | 741 | ||
| 744 | return; | 742 | return 0; |
| 745 | 743 | ||
| 746 | cs_failed: | 744 | cs_failed: |
| 747 | cs_error(link, last_fn, last_ret); | 745 | cs_error(link, last_fn, last_ret); |
| 748 | 746 | ||
| 749 | failed: | 747 | failed: |
| 750 | btuart_release(link); | 748 | btuart_release(link); |
| 749 | return -ENODEV; | ||
| 751 | } | 750 | } |
| 752 | 751 | ||
| 753 | 752 | ||
| @@ -772,7 +771,7 @@ static struct pcmcia_driver btuart_driver = { | |||
| 772 | .drv = { | 771 | .drv = { |
| 773 | .name = "btuart_cs", | 772 | .name = "btuart_cs", |
| 774 | }, | 773 | }, |
| 775 | .probe = btuart_attach, | 774 | .probe = btuart_probe, |
| 776 | .remove = btuart_detach, | 775 | .remove = btuart_detach, |
| 777 | .id_table = btuart_ids, | 776 | .id_table = btuart_ids, |
| 778 | }; | 777 | }; |
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c index 416433b4a348..0ec7fd4c9214 100644 --- a/drivers/bluetooth/dtl1_cs.c +++ b/drivers/bluetooth/dtl1_cs.c | |||
| @@ -87,7 +87,7 @@ typedef struct dtl1_info_t { | |||
| 87 | } dtl1_info_t; | 87 | } dtl1_info_t; |
| 88 | 88 | ||
| 89 | 89 | ||
| 90 | static void dtl1_config(struct pcmcia_device *link); | 90 | static int dtl1_config(struct pcmcia_device *link); |
| 91 | static void dtl1_release(struct pcmcia_device *link); | 91 | static void dtl1_release(struct pcmcia_device *link); |
| 92 | 92 | ||
| 93 | static void dtl1_detach(struct pcmcia_device *p_dev); | 93 | static void dtl1_detach(struct pcmcia_device *p_dev); |
| @@ -555,7 +555,7 @@ static int dtl1_close(dtl1_info_t *info) | |||
| 555 | return 0; | 555 | return 0; |
| 556 | } | 556 | } |
| 557 | 557 | ||
| 558 | static int dtl1_attach(struct pcmcia_device *link) | 558 | static int dtl1_probe(struct pcmcia_device *link) |
| 559 | { | 559 | { |
| 560 | dtl1_info_t *info; | 560 | dtl1_info_t *info; |
| 561 | 561 | ||
| @@ -579,9 +579,7 @@ static int dtl1_attach(struct pcmcia_device *link) | |||
| 579 | link->conf.IntType = INT_MEMORY_AND_IO; | 579 | link->conf.IntType = INT_MEMORY_AND_IO; |
| 580 | 580 | ||
| 581 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 581 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 582 | dtl1_config(link); | 582 | return dtl1_config(link); |
| 583 | |||
| 584 | return 0; | ||
| 585 | } | 583 | } |
| 586 | 584 | ||
| 587 | 585 | ||
| @@ -620,7 +618,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t * | |||
| 620 | return get_tuple(handle, tuple, parse); | 618 | return get_tuple(handle, tuple, parse); |
| 621 | } | 619 | } |
| 622 | 620 | ||
| 623 | static void dtl1_config(struct pcmcia_device *link) | 621 | static int dtl1_config(struct pcmcia_device *link) |
| 624 | { | 622 | { |
| 625 | dtl1_info_t *info = link->priv; | 623 | dtl1_info_t *info = link->priv; |
| 626 | tuple_t tuple; | 624 | tuple_t tuple; |
| @@ -693,13 +691,14 @@ static void dtl1_config(struct pcmcia_device *link) | |||
| 693 | link->dev_node = &info->node; | 691 | link->dev_node = &info->node; |
| 694 | link->state &= ~DEV_CONFIG_PENDING; | 692 | link->state &= ~DEV_CONFIG_PENDING; |
| 695 | 693 | ||
| 696 | return; | 694 | return 0; |
| 697 | 695 | ||
| 698 | cs_failed: | 696 | cs_failed: |
| 699 | cs_error(link, last_fn, last_ret); | 697 | cs_error(link, last_fn, last_ret); |
| 700 | 698 | ||
| 701 | failed: | 699 | failed: |
| 702 | dtl1_release(link); | 700 | dtl1_release(link); |
| 701 | return -ENODEV; | ||
| 703 | } | 702 | } |
| 704 | 703 | ||
| 705 | 704 | ||
| @@ -727,7 +726,7 @@ static struct pcmcia_driver dtl1_driver = { | |||
| 727 | .drv = { | 726 | .drv = { |
| 728 | .name = "dtl1_cs", | 727 | .name = "dtl1_cs", |
| 729 | }, | 728 | }, |
| 730 | .probe = dtl1_attach, | 729 | .probe = dtl1_probe, |
| 731 | .remove = dtl1_detach, | 730 | .remove = dtl1_detach, |
| 732 | .id_table = dtl1_ids, | 731 | .id_table = dtl1_ids, |
| 733 | }; | 732 | }; |
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c index 79b8ad0e32df..22dce9d47b2b 100644 --- a/drivers/char/pcmcia/cm4000_cs.c +++ b/drivers/char/pcmcia/cm4000_cs.c | |||
| @@ -1759,7 +1759,7 @@ static void cmm_cm4000_release(struct pcmcia_device * link) | |||
| 1759 | 1759 | ||
| 1760 | /*==== Interface to PCMCIA Layer =======================================*/ | 1760 | /*==== Interface to PCMCIA Layer =======================================*/ |
| 1761 | 1761 | ||
| 1762 | static void cm4000_config(struct pcmcia_device * link, int devno) | 1762 | static int cm4000_config(struct pcmcia_device * link, int devno) |
| 1763 | { | 1763 | { |
| 1764 | struct cm4000_dev *dev; | 1764 | struct cm4000_dev *dev; |
| 1765 | tuple_t tuple; | 1765 | tuple_t tuple; |
| @@ -1846,7 +1846,7 @@ static void cm4000_config(struct pcmcia_device * link, int devno) | |||
| 1846 | link->dev_node = &dev->node; | 1846 | link->dev_node = &dev->node; |
| 1847 | link->state &= ~DEV_CONFIG_PENDING; | 1847 | link->state &= ~DEV_CONFIG_PENDING; |
| 1848 | 1848 | ||
| 1849 | return; | 1849 | return 0; |
| 1850 | 1850 | ||
| 1851 | cs_failed: | 1851 | cs_failed: |
| 1852 | cs_error(link, fail_fn, fail_rc); | 1852 | cs_error(link, fail_fn, fail_rc); |
| @@ -1854,6 +1854,7 @@ cs_release: | |||
| 1854 | cm4000_release(link); | 1854 | cm4000_release(link); |
| 1855 | 1855 | ||
| 1856 | link->state &= ~DEV_CONFIG_PENDING; | 1856 | link->state &= ~DEV_CONFIG_PENDING; |
| 1857 | return -ENODEV; | ||
| 1857 | } | 1858 | } |
| 1858 | 1859 | ||
| 1859 | static int cm4000_suspend(struct pcmcia_device *link) | 1860 | static int cm4000_suspend(struct pcmcia_device *link) |
| @@ -1883,10 +1884,10 @@ static void cm4000_release(struct pcmcia_device *link) | |||
| 1883 | pcmcia_disable_device(link); | 1884 | pcmcia_disable_device(link); |
| 1884 | } | 1885 | } |
| 1885 | 1886 | ||
| 1886 | static int cm4000_attach(struct pcmcia_device *link) | 1887 | static int cm4000_probe(struct pcmcia_device *link) |
| 1887 | { | 1888 | { |
| 1888 | struct cm4000_dev *dev; | 1889 | struct cm4000_dev *dev; |
| 1889 | int i; | 1890 | int i, ret; |
| 1890 | 1891 | ||
| 1891 | for (i = 0; i < CM4000_MAX_DEV; i++) | 1892 | for (i = 0; i < CM4000_MAX_DEV; i++) |
| 1892 | if (dev_table[i] == NULL) | 1893 | if (dev_table[i] == NULL) |
| @@ -1913,7 +1914,9 @@ static int cm4000_attach(struct pcmcia_device *link) | |||
| 1913 | init_waitqueue_head(&dev->readq); | 1914 | init_waitqueue_head(&dev->readq); |
| 1914 | 1915 | ||
| 1915 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 1916 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 1916 | cm4000_config(link, i); | 1917 | ret = cm4000_config(link, i); |
| 1918 | if (ret) | ||
| 1919 | return ret; | ||
| 1917 | 1920 | ||
| 1918 | class_device_create(cmm_class, NULL, MKDEV(major, i), NULL, | 1921 | class_device_create(cmm_class, NULL, MKDEV(major, i), NULL, |
| 1919 | "cmm%d", i); | 1922 | "cmm%d", i); |
| @@ -1968,7 +1971,7 @@ static struct pcmcia_driver cm4000_driver = { | |||
| 1968 | .drv = { | 1971 | .drv = { |
| 1969 | .name = "cm4000_cs", | 1972 | .name = "cm4000_cs", |
| 1970 | }, | 1973 | }, |
| 1971 | .probe = cm4000_attach, | 1974 | .probe = cm4000_probe, |
| 1972 | .remove = cm4000_detach, | 1975 | .remove = cm4000_detach, |
| 1973 | .suspend = cm4000_suspend, | 1976 | .suspend = cm4000_suspend, |
| 1974 | .resume = cm4000_resume, | 1977 | .resume = cm4000_resume, |
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c index 8334226e103c..6ccca8cbabc1 100644 --- a/drivers/char/pcmcia/cm4040_cs.c +++ b/drivers/char/pcmcia/cm4040_cs.c | |||
| @@ -514,7 +514,7 @@ static void cm4040_reader_release(struct pcmcia_device *link) | |||
| 514 | return; | 514 | return; |
| 515 | } | 515 | } |
| 516 | 516 | ||
| 517 | static void reader_config(struct pcmcia_device *link, int devno) | 517 | static int reader_config(struct pcmcia_device *link, int devno) |
| 518 | { | 518 | { |
| 519 | struct reader_dev *dev; | 519 | struct reader_dev *dev; |
| 520 | tuple_t tuple; | 520 | tuple_t tuple; |
| @@ -610,13 +610,14 @@ static void reader_config(struct pcmcia_device *link, int devno) | |||
| 610 | link->io.BasePort1, link->io.BasePort1+link->io.NumPorts1); | 610 | link->io.BasePort1, link->io.BasePort1+link->io.NumPorts1); |
| 611 | DEBUGP(2, dev, "<- reader_config (succ)\n"); | 611 | DEBUGP(2, dev, "<- reader_config (succ)\n"); |
| 612 | 612 | ||
| 613 | return; | 613 | return 0; |
| 614 | 614 | ||
| 615 | cs_failed: | 615 | cs_failed: |
| 616 | cs_error(link, fail_fn, fail_rc); | 616 | cs_error(link, fail_fn, fail_rc); |
| 617 | cs_release: | 617 | cs_release: |
| 618 | reader_release(link); | 618 | reader_release(link); |
| 619 | link->state &= ~DEV_CONFIG_PENDING; | 619 | link->state &= ~DEV_CONFIG_PENDING; |
| 620 | return -ENODEV; | ||
| 620 | } | 621 | } |
| 621 | 622 | ||
| 622 | static void reader_release(struct pcmcia_device *link) | 623 | static void reader_release(struct pcmcia_device *link) |
| @@ -625,10 +626,10 @@ static void reader_release(struct pcmcia_device *link) | |||
| 625 | pcmcia_disable_device(link); | 626 | pcmcia_disable_device(link); |
| 626 | } | 627 | } |
| 627 | 628 | ||
| 628 | static int reader_attach(struct pcmcia_device *link) | 629 | static int reader_probe(struct pcmcia_device *link) |
| 629 | { | 630 | { |
| 630 | struct reader_dev *dev; | 631 | struct reader_dev *dev; |
| 631 | int i; | 632 | int i, ret; |
| 632 | 633 | ||
| 633 | for (i = 0; i < CM_MAX_DEV; i++) { | 634 | for (i = 0; i < CM_MAX_DEV; i++) { |
| 634 | if (dev_table[i] == NULL) | 635 | if (dev_table[i] == NULL) |
| @@ -659,7 +660,9 @@ static int reader_attach(struct pcmcia_device *link) | |||
| 659 | dev->poll_timer.function = &cm4040_do_poll; | 660 | dev->poll_timer.function = &cm4040_do_poll; |
| 660 | 661 | ||
| 661 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 662 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 662 | reader_config(link, i); | 663 | ret = reader_config(link, i); |
| 664 | if (ret) | ||
| 665 | return ret; | ||
| 663 | 666 | ||
| 664 | class_device_create(cmx_class, NULL, MKDEV(major, i), NULL, | 667 | class_device_create(cmx_class, NULL, MKDEV(major, i), NULL, |
| 665 | "cmx%d", i); | 668 | "cmx%d", i); |
| @@ -715,7 +718,7 @@ static struct pcmcia_driver reader_driver = { | |||
| 715 | .drv = { | 718 | .drv = { |
| 716 | .name = "cm4040_cs", | 719 | .name = "cm4040_cs", |
| 717 | }, | 720 | }, |
| 718 | .probe = reader_attach, | 721 | .probe = reader_probe, |
| 719 | .remove = reader_detach, | 722 | .remove = reader_detach, |
| 720 | .id_table = cm4040_ids, | 723 | .id_table = cm4040_ids, |
| 721 | }; | 724 | }; |
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 9bfd90e5d6b7..ef7a81314f0c 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c | |||
| @@ -484,7 +484,7 @@ static void mgslpc_wait_until_sent(struct tty_struct *tty, int timeout); | |||
| 484 | 484 | ||
| 485 | /* PCMCIA prototypes */ | 485 | /* PCMCIA prototypes */ |
| 486 | 486 | ||
| 487 | static void mgslpc_config(struct pcmcia_device *link); | 487 | static int mgslpc_config(struct pcmcia_device *link); |
| 488 | static void mgslpc_release(u_long arg); | 488 | static void mgslpc_release(u_long arg); |
| 489 | static void mgslpc_detach(struct pcmcia_device *p_dev); | 489 | static void mgslpc_detach(struct pcmcia_device *p_dev); |
| 490 | 490 | ||
| @@ -533,9 +533,10 @@ static void ldisc_receive_buf(struct tty_struct *tty, | |||
| 533 | } | 533 | } |
| 534 | } | 534 | } |
| 535 | 535 | ||
| 536 | static int mgslpc_attach(struct pcmcia_device *link) | 536 | static int mgslpc_probe(struct pcmcia_device *link) |
| 537 | { | 537 | { |
| 538 | MGSLPC_INFO *info; | 538 | MGSLPC_INFO *info; |
| 539 | int ret; | ||
| 539 | 540 | ||
| 540 | if (debug_level >= DEBUG_LEVEL_INFO) | 541 | if (debug_level >= DEBUG_LEVEL_INFO) |
| 541 | printk("mgslpc_attach\n"); | 542 | printk("mgslpc_attach\n"); |
| @@ -578,7 +579,9 @@ static int mgslpc_attach(struct pcmcia_device *link) | |||
| 578 | link->conf.IntType = INT_MEMORY_AND_IO; | 579 | link->conf.IntType = INT_MEMORY_AND_IO; |
| 579 | 580 | ||
| 580 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 581 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 581 | mgslpc_config(link); | 582 | ret = mgslpc_config(link); |
| 583 | if (ret) | ||
| 584 | return ret; | ||
| 582 | 585 | ||
| 583 | mgslpc_add_device(info); | 586 | mgslpc_add_device(info); |
| 584 | 587 | ||
| @@ -591,7 +594,7 @@ static int mgslpc_attach(struct pcmcia_device *link) | |||
| 591 | #define CS_CHECK(fn, ret) \ | 594 | #define CS_CHECK(fn, ret) \ |
| 592 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 595 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
| 593 | 596 | ||
| 594 | static void mgslpc_config(struct pcmcia_device *link) | 597 | static int mgslpc_config(struct pcmcia_device *link) |
| 595 | { | 598 | { |
| 596 | MGSLPC_INFO *info = link->priv; | 599 | MGSLPC_INFO *info = link->priv; |
| 597 | tuple_t tuple; | 600 | tuple_t tuple; |
| @@ -680,11 +683,12 @@ static void mgslpc_config(struct pcmcia_device *link) | |||
| 680 | printk("\n"); | 683 | printk("\n"); |
| 681 | 684 | ||
| 682 | link->state &= ~DEV_CONFIG_PENDING; | 685 | link->state &= ~DEV_CONFIG_PENDING; |
| 683 | return; | 686 | return 0; |
| 684 | 687 | ||
| 685 | cs_failed: | 688 | cs_failed: |
| 686 | cs_error(link, last_fn, last_ret); | 689 | cs_error(link, last_fn, last_ret); |
| 687 | mgslpc_release((u_long)link); | 690 | mgslpc_release((u_long)link); |
| 691 | return -ENODEV; | ||
| 688 | } | 692 | } |
| 689 | 693 | ||
| 690 | /* Card has been removed. | 694 | /* Card has been removed. |
| @@ -3003,7 +3007,7 @@ static struct pcmcia_driver mgslpc_driver = { | |||
| 3003 | .drv = { | 3007 | .drv = { |
| 3004 | .name = "synclink_cs", | 3008 | .name = "synclink_cs", |
| 3005 | }, | 3009 | }, |
| 3006 | .probe = mgslpc_attach, | 3010 | .probe = mgslpc_probe, |
| 3007 | .remove = mgslpc_detach, | 3011 | .remove = mgslpc_detach, |
| 3008 | .id_table = mgslpc_ids, | 3012 | .id_table = mgslpc_ids, |
| 3009 | .suspend = mgslpc_suspend, | 3013 | .suspend = mgslpc_suspend, |
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c index 58690c1ff6ba..56c8e828c6e6 100644 --- a/drivers/ide/legacy/ide-cs.c +++ b/drivers/ide/legacy/ide-cs.c | |||
| @@ -88,7 +88,7 @@ typedef struct ide_info_t { | |||
| 88 | } ide_info_t; | 88 | } ide_info_t; |
| 89 | 89 | ||
| 90 | static void ide_release(struct pcmcia_device *); | 90 | static void ide_release(struct pcmcia_device *); |
| 91 | static void ide_config(struct pcmcia_device *); | 91 | static int ide_config(struct pcmcia_device *); |
| 92 | 92 | ||
| 93 | static void ide_detach(struct pcmcia_device *p_dev); | 93 | static void ide_detach(struct pcmcia_device *p_dev); |
| 94 | 94 | ||
| @@ -103,7 +103,7 @@ static void ide_detach(struct pcmcia_device *p_dev); | |||
| 103 | 103 | ||
| 104 | ======================================================================*/ | 104 | ======================================================================*/ |
| 105 | 105 | ||
| 106 | static int ide_attach(struct pcmcia_device *link) | 106 | static int ide_probe(struct pcmcia_device *link) |
| 107 | { | 107 | { |
| 108 | ide_info_t *info; | 108 | ide_info_t *info; |
| 109 | 109 | ||
| @@ -126,9 +126,7 @@ static int ide_attach(struct pcmcia_device *link) | |||
| 126 | link->conf.IntType = INT_MEMORY_AND_IO; | 126 | link->conf.IntType = INT_MEMORY_AND_IO; |
| 127 | 127 | ||
| 128 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 128 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 129 | ide_config(link); | 129 | return ide_config(link); |
| 130 | |||
| 131 | return 0; | ||
| 132 | } /* ide_attach */ | 130 | } /* ide_attach */ |
| 133 | 131 | ||
| 134 | /*====================================================================== | 132 | /*====================================================================== |
| @@ -172,7 +170,7 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq | |||
| 172 | #define CS_CHECK(fn, ret) \ | 170 | #define CS_CHECK(fn, ret) \ |
| 173 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 171 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
| 174 | 172 | ||
| 175 | static void ide_config(struct pcmcia_device *link) | 173 | static int ide_config(struct pcmcia_device *link) |
| 176 | { | 174 | { |
| 177 | ide_info_t *info = link->priv; | 175 | ide_info_t *info = link->priv; |
| 178 | tuple_t tuple; | 176 | tuple_t tuple; |
| @@ -327,7 +325,7 @@ static void ide_config(struct pcmcia_device *link) | |||
| 327 | 325 | ||
| 328 | link->state &= ~DEV_CONFIG_PENDING; | 326 | link->state &= ~DEV_CONFIG_PENDING; |
| 329 | kfree(stk); | 327 | kfree(stk); |
| 330 | return; | 328 | return 0; |
| 331 | 329 | ||
| 332 | err_mem: | 330 | err_mem: |
| 333 | printk(KERN_NOTICE "ide-cs: ide_config failed memory allocation\n"); | 331 | printk(KERN_NOTICE "ide-cs: ide_config failed memory allocation\n"); |
| @@ -339,6 +337,7 @@ failed: | |||
| 339 | kfree(stk); | 337 | kfree(stk); |
| 340 | ide_release(link); | 338 | ide_release(link); |
| 341 | link->state &= ~DEV_CONFIG_PENDING; | 339 | link->state &= ~DEV_CONFIG_PENDING; |
| 340 | return -ENODEV; | ||
| 342 | } /* ide_config */ | 341 | } /* ide_config */ |
| 343 | 342 | ||
| 344 | /*====================================================================== | 343 | /*====================================================================== |
| @@ -424,7 +423,7 @@ static struct pcmcia_driver ide_cs_driver = { | |||
| 424 | .drv = { | 423 | .drv = { |
| 425 | .name = "ide-cs", | 424 | .name = "ide-cs", |
| 426 | }, | 425 | }, |
| 427 | .probe = ide_attach, | 426 | .probe = ide_probe, |
| 428 | .remove = ide_detach, | 427 | .remove = ide_detach, |
| 429 | .id_table = ide_ids, | 428 | .id_table = ide_ids, |
| 430 | }; | 429 | }; |
diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c index c9c794e2926d..28f9211726c5 100644 --- a/drivers/isdn/hardware/avm/avm_cs.c +++ b/drivers/isdn/hardware/avm/avm_cs.c | |||
| @@ -51,7 +51,7 @@ MODULE_LICENSE("GPL"); | |||
| 51 | handler. | 51 | handler. |
| 52 | */ | 52 | */ |
| 53 | 53 | ||
| 54 | static void avmcs_config(struct pcmcia_device *link); | 54 | static int avmcs_config(struct pcmcia_device *link); |
| 55 | static void avmcs_release(struct pcmcia_device *link); | 55 | static void avmcs_release(struct pcmcia_device *link); |
| 56 | 56 | ||
| 57 | /* | 57 | /* |
| @@ -99,7 +99,7 @@ typedef struct local_info_t { | |||
| 99 | 99 | ||
| 100 | ======================================================================*/ | 100 | ======================================================================*/ |
| 101 | 101 | ||
| 102 | static int avmcs_attach(struct pcmcia_device *p_dev) | 102 | static int avmcs_probe(struct pcmcia_device *p_dev) |
| 103 | { | 103 | { |
| 104 | local_info_t *local; | 104 | local_info_t *local; |
| 105 | 105 | ||
| @@ -128,12 +128,10 @@ static int avmcs_attach(struct pcmcia_device *p_dev) | |||
| 128 | p_dev->priv = local; | 128 | p_dev->priv = local; |
| 129 | 129 | ||
| 130 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 130 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 131 | avmcs_config(p_dev); | 131 | return avmcs_config(p_dev); |
| 132 | |||
| 133 | return 0; | ||
| 134 | 132 | ||
| 135 | err: | 133 | err: |
| 136 | return -EINVAL; | 134 | return -ENOMEM; |
| 137 | } /* avmcs_attach */ | 135 | } /* avmcs_attach */ |
| 138 | 136 | ||
| 139 | /*====================================================================== | 137 | /*====================================================================== |
| @@ -185,7 +183,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, | |||
| 185 | return get_tuple(handle, tuple, parse); | 183 | return get_tuple(handle, tuple, parse); |
| 186 | } | 184 | } |
| 187 | 185 | ||
| 188 | static void avmcs_config(struct pcmcia_device *link) | 186 | static int avmcs_config(struct pcmcia_device *link) |
| 189 | { | 187 | { |
| 190 | tuple_t tuple; | 188 | tuple_t tuple; |
| 191 | cisparse_t parse; | 189 | cisparse_t parse; |
| @@ -219,7 +217,7 @@ static void avmcs_config(struct pcmcia_device *link) | |||
| 219 | if (i != CS_SUCCESS) { | 217 | if (i != CS_SUCCESS) { |
| 220 | cs_error(link, ParseTuple, i); | 218 | cs_error(link, ParseTuple, i); |
| 221 | link->state &= ~DEV_CONFIG_PENDING; | 219 | link->state &= ~DEV_CONFIG_PENDING; |
| 222 | return; | 220 | return -ENODEV; |
| 223 | } | 221 | } |
| 224 | 222 | ||
| 225 | /* Configure card */ | 223 | /* Configure card */ |
| @@ -319,7 +317,7 @@ found_port: | |||
| 319 | /* If any step failed, release any partially configured state */ | 317 | /* If any step failed, release any partially configured state */ |
| 320 | if (i != 0) { | 318 | if (i != 0) { |
| 321 | avmcs_release(link); | 319 | avmcs_release(link); |
| 322 | return; | 320 | return -ENODEV; |
| 323 | } | 321 | } |
| 324 | 322 | ||
| 325 | 323 | ||
| @@ -333,9 +331,10 @@ found_port: | |||
| 333 | printk(KERN_ERR "avm_cs: failed to add AVM-%s-Controller at i/o %#x, irq %d\n", | 331 | printk(KERN_ERR "avm_cs: failed to add AVM-%s-Controller at i/o %#x, irq %d\n", |
| 334 | dev->node.dev_name, link->io.BasePort1, link->irq.AssignedIRQ); | 332 | dev->node.dev_name, link->io.BasePort1, link->irq.AssignedIRQ); |
| 335 | avmcs_release(link); | 333 | avmcs_release(link); |
| 336 | return; | 334 | return -ENODEV; |
| 337 | } | 335 | } |
| 338 | dev->node.minor = i; | 336 | dev->node.minor = i; |
| 337 | return 0; | ||
| 339 | 338 | ||
| 340 | } /* avmcs_config */ | 339 | } /* avmcs_config */ |
| 341 | 340 | ||
| @@ -367,7 +366,7 @@ static struct pcmcia_driver avmcs_driver = { | |||
| 367 | .drv = { | 366 | .drv = { |
| 368 | .name = "avm_cs", | 367 | .name = "avm_cs", |
| 369 | }, | 368 | }, |
| 370 | .probe = avmcs_attach, | 369 | .probe = avmcs_probe, |
| 371 | .remove = avmcs_detach, | 370 | .remove = avmcs_detach, |
| 372 | .id_table = avmcs_ids, | 371 | .id_table = avmcs_ids, |
| 373 | }; | 372 | }; |
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c index ff6b0e185bc4..11c7c4f09e7e 100644 --- a/drivers/isdn/hisax/avma1_cs.c +++ b/drivers/isdn/hisax/avma1_cs.c | |||
| @@ -67,7 +67,7 @@ module_param(isdnprot, int, 0); | |||
| 67 | handler. | 67 | handler. |
| 68 | */ | 68 | */ |
| 69 | 69 | ||
| 70 | static void avma1cs_config(struct pcmcia_device *link); | 70 | static int avma1cs_config(struct pcmcia_device *link); |
| 71 | static void avma1cs_release(struct pcmcia_device *link); | 71 | static void avma1cs_release(struct pcmcia_device *link); |
| 72 | 72 | ||
| 73 | /* | 73 | /* |
| @@ -116,7 +116,7 @@ typedef struct local_info_t { | |||
| 116 | 116 | ||
| 117 | ======================================================================*/ | 117 | ======================================================================*/ |
| 118 | 118 | ||
| 119 | static int avma1cs_attach(struct pcmcia_device *p_dev) | 119 | static int avma1cs_probe(struct pcmcia_device *p_dev) |
| 120 | { | 120 | { |
| 121 | local_info_t *local; | 121 | local_info_t *local; |
| 122 | 122 | ||
| @@ -150,9 +150,7 @@ static int avma1cs_attach(struct pcmcia_device *p_dev) | |||
| 150 | p_dev->conf.Present = PRESENT_OPTION; | 150 | p_dev->conf.Present = PRESENT_OPTION; |
| 151 | 151 | ||
| 152 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 152 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 153 | avma1cs_config(p_dev); | 153 | return avma1cs_config(p_dev); |
| 154 | |||
| 155 | return 0; | ||
| 156 | } /* avma1cs_attach */ | 154 | } /* avma1cs_attach */ |
| 157 | 155 | ||
| 158 | /*====================================================================== | 156 | /*====================================================================== |
| @@ -206,7 +204,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, | |||
| 206 | return get_tuple(handle, tuple, parse); | 204 | return get_tuple(handle, tuple, parse); |
| 207 | } | 205 | } |
| 208 | 206 | ||
| 209 | static void avma1cs_config(struct pcmcia_device *link) | 207 | static int avma1cs_config(struct pcmcia_device *link) |
| 210 | { | 208 | { |
| 211 | tuple_t tuple; | 209 | tuple_t tuple; |
| 212 | cisparse_t parse; | 210 | cisparse_t parse; |
| @@ -242,7 +240,7 @@ static void avma1cs_config(struct pcmcia_device *link) | |||
| 242 | if (i != CS_SUCCESS) { | 240 | if (i != CS_SUCCESS) { |
| 243 | cs_error(link, ParseTuple, i); | 241 | cs_error(link, ParseTuple, i); |
| 244 | link->state &= ~DEV_CONFIG_PENDING; | 242 | link->state &= ~DEV_CONFIG_PENDING; |
| 245 | return; | 243 | return -ENODEV; |
| 246 | } | 244 | } |
| 247 | 245 | ||
| 248 | /* Configure card */ | 246 | /* Configure card */ |
| @@ -325,7 +323,7 @@ found_port: | |||
| 325 | /* If any step failed, release any partially configured state */ | 323 | /* If any step failed, release any partially configured state */ |
| 326 | if (i != 0) { | 324 | if (i != 0) { |
| 327 | avma1cs_release(link); | 325 | avma1cs_release(link); |
| 328 | return; | 326 | return -ENODEV; |
| 329 | } | 327 | } |
| 330 | 328 | ||
| 331 | printk(KERN_NOTICE "avma1_cs: checking at i/o %#x, irq %d\n", | 329 | printk(KERN_NOTICE "avma1_cs: checking at i/o %#x, irq %d\n", |
| @@ -340,10 +338,11 @@ found_port: | |||
| 340 | if (i < 0) { | 338 | if (i < 0) { |
| 341 | printk(KERN_ERR "avma1_cs: failed to initialize AVM A1 PCMCIA %d at i/o %#x\n", i, link->io.BasePort1); | 339 | printk(KERN_ERR "avma1_cs: failed to initialize AVM A1 PCMCIA %d at i/o %#x\n", i, link->io.BasePort1); |
| 342 | avma1cs_release(link); | 340 | avma1cs_release(link); |
| 343 | return; | 341 | return -ENODEV; |
| 344 | } | 342 | } |
| 345 | dev->node.minor = i; | 343 | dev->node.minor = i; |
| 346 | 344 | ||
| 345 | return 0; | ||
| 347 | } /* avma1cs_config */ | 346 | } /* avma1cs_config */ |
| 348 | 347 | ||
| 349 | /*====================================================================== | 348 | /*====================================================================== |
| @@ -379,7 +378,7 @@ static struct pcmcia_driver avma1cs_driver = { | |||
| 379 | .drv = { | 378 | .drv = { |
| 380 | .name = "avma1_cs", | 379 | .name = "avma1_cs", |
| 381 | }, | 380 | }, |
| 382 | .probe = avma1cs_attach, | 381 | .probe = avma1cs_probe, |
| 383 | .remove = avma1cs_detach, | 382 | .remove = avma1cs_detach, |
| 384 | .id_table = avma1cs_ids, | 383 | .id_table = avma1cs_ids, |
| 385 | }; | 384 | }; |
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c index 7a42bd43162f..4856680ce761 100644 --- a/drivers/isdn/hisax/elsa_cs.c +++ b/drivers/isdn/hisax/elsa_cs.c | |||
| @@ -94,7 +94,7 @@ module_param(protocol, int, 0); | |||
| 94 | handler. | 94 | handler. |
| 95 | */ | 95 | */ |
| 96 | 96 | ||
| 97 | static void elsa_cs_config(struct pcmcia_device *link); | 97 | static int elsa_cs_config(struct pcmcia_device *link); |
| 98 | static void elsa_cs_release(struct pcmcia_device *link); | 98 | static void elsa_cs_release(struct pcmcia_device *link); |
| 99 | 99 | ||
| 100 | /* | 100 | /* |
| @@ -139,7 +139,7 @@ typedef struct local_info_t { | |||
| 139 | 139 | ||
| 140 | ======================================================================*/ | 140 | ======================================================================*/ |
| 141 | 141 | ||
| 142 | static int elsa_cs_attach(struct pcmcia_device *link) | 142 | static int elsa_cs_probe(struct pcmcia_device *link) |
| 143 | { | 143 | { |
| 144 | local_info_t *local; | 144 | local_info_t *local; |
| 145 | 145 | ||
| @@ -175,9 +175,7 @@ static int elsa_cs_attach(struct pcmcia_device *link) | |||
| 175 | link->conf.IntType = INT_MEMORY_AND_IO; | 175 | link->conf.IntType = INT_MEMORY_AND_IO; |
| 176 | 176 | ||
| 177 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 177 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 178 | elsa_cs_config(link); | 178 | return elsa_cs_config(link); |
| 179 | |||
| 180 | return 0; | ||
| 181 | } /* elsa_cs_attach */ | 179 | } /* elsa_cs_attach */ |
| 182 | 180 | ||
| 183 | /*====================================================================== | 181 | /*====================================================================== |
| @@ -235,7 +233,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, | |||
| 235 | return get_tuple(handle, tuple, parse); | 233 | return get_tuple(handle, tuple, parse); |
| 236 | } | 234 | } |
| 237 | 235 | ||
| 238 | static void elsa_cs_config(struct pcmcia_device *link) | 236 | static int elsa_cs_config(struct pcmcia_device *link) |
| 239 | { | 237 | { |
| 240 | tuple_t tuple; | 238 | tuple_t tuple; |
| 241 | cisparse_t parse; | 239 | cisparse_t parse; |
| @@ -346,10 +344,11 @@ static void elsa_cs_config(struct pcmcia_device *link) | |||
| 346 | } else | 344 | } else |
| 347 | ((local_info_t*)link->priv)->cardnr = i; | 345 | ((local_info_t*)link->priv)->cardnr = i; |
| 348 | 346 | ||
| 349 | return; | 347 | return 0; |
| 350 | cs_failed: | 348 | cs_failed: |
| 351 | cs_error(link, last_fn, i); | 349 | cs_error(link, last_fn, i); |
| 352 | elsa_cs_release(link); | 350 | elsa_cs_release(link); |
| 351 | return -ENODEV; | ||
| 353 | } /* elsa_cs_config */ | 352 | } /* elsa_cs_config */ |
| 354 | 353 | ||
| 355 | /*====================================================================== | 354 | /*====================================================================== |
| @@ -406,7 +405,7 @@ static struct pcmcia_driver elsa_cs_driver = { | |||
| 406 | .drv = { | 405 | .drv = { |
| 407 | .name = "elsa_cs", | 406 | .name = "elsa_cs", |
| 408 | }, | 407 | }, |
| 409 | .probe = elsa_cs_attach, | 408 | .probe = elsa_cs_probe, |
| 410 | .remove = elsa_cs_detach, | 409 | .remove = elsa_cs_detach, |
| 411 | .id_table = elsa_ids, | 410 | .id_table = elsa_ids, |
| 412 | .suspend = elsa_suspend, | 411 | .suspend = elsa_suspend, |
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c index 2af48a684654..a35a29586a62 100644 --- a/drivers/isdn/hisax/sedlbauer_cs.c +++ b/drivers/isdn/hisax/sedlbauer_cs.c | |||
| @@ -95,7 +95,7 @@ module_param(protocol, int, 0); | |||
| 95 | event handler. | 95 | event handler. |
| 96 | */ | 96 | */ |
| 97 | 97 | ||
| 98 | static void sedlbauer_config(struct pcmcia_device *link); | 98 | static int sedlbauer_config(struct pcmcia_device *link); |
| 99 | static void sedlbauer_release(struct pcmcia_device *link); | 99 | static void sedlbauer_release(struct pcmcia_device *link); |
| 100 | 100 | ||
| 101 | /* | 101 | /* |
| @@ -148,7 +148,7 @@ typedef struct local_info_t { | |||
| 148 | 148 | ||
| 149 | ======================================================================*/ | 149 | ======================================================================*/ |
| 150 | 150 | ||
| 151 | static int sedlbauer_attach(struct pcmcia_device *link) | 151 | static int sedlbauer_probe(struct pcmcia_device *link) |
| 152 | { | 152 | { |
| 153 | local_info_t *local; | 153 | local_info_t *local; |
| 154 | 154 | ||
| @@ -187,9 +187,7 @@ static int sedlbauer_attach(struct pcmcia_device *link) | |||
| 187 | link->conf.IntType = INT_MEMORY_AND_IO; | 187 | link->conf.IntType = INT_MEMORY_AND_IO; |
| 188 | 188 | ||
| 189 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 189 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 190 | sedlbauer_config(link); | 190 | return sedlbauer_config(link); |
| 191 | |||
| 192 | return 0; | ||
| 193 | } /* sedlbauer_attach */ | 191 | } /* sedlbauer_attach */ |
| 194 | 192 | ||
| 195 | /*====================================================================== | 193 | /*====================================================================== |
| @@ -224,7 +222,7 @@ static void sedlbauer_detach(struct pcmcia_device *link) | |||
| 224 | #define CS_CHECK(fn, ret) \ | 222 | #define CS_CHECK(fn, ret) \ |
| 225 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 223 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
| 226 | 224 | ||
| 227 | static void sedlbauer_config(struct pcmcia_device *link) | 225 | static int sedlbauer_config(struct pcmcia_device *link) |
| 228 | { | 226 | { |
| 229 | local_info_t *dev = link->priv; | 227 | local_info_t *dev = link->priv; |
| 230 | tuple_t tuple; | 228 | tuple_t tuple; |
| @@ -423,14 +421,16 @@ static void sedlbauer_config(struct pcmcia_device *link) | |||
| 423 | printk(KERN_ERR "sedlbauer_cs: failed to initialize SEDLBAUER PCMCIA %d at i/o %#x\n", | 421 | printk(KERN_ERR "sedlbauer_cs: failed to initialize SEDLBAUER PCMCIA %d at i/o %#x\n", |
| 424 | last_ret, link->io.BasePort1); | 422 | last_ret, link->io.BasePort1); |
| 425 | sedlbauer_release(link); | 423 | sedlbauer_release(link); |
| 424 | return -ENODEV; | ||
| 426 | } else | 425 | } else |
| 427 | ((local_info_t*)link->priv)->cardnr = last_ret; | 426 | ((local_info_t*)link->priv)->cardnr = last_ret; |
| 428 | 427 | ||
| 429 | return; | 428 | return 0; |
| 430 | 429 | ||
| 431 | cs_failed: | 430 | cs_failed: |
| 432 | cs_error(link, last_fn, last_ret); | 431 | cs_error(link, last_fn, last_ret); |
| 433 | sedlbauer_release(link); | 432 | sedlbauer_release(link); |
| 433 | return -ENODEV; | ||
| 434 | 434 | ||
| 435 | } /* sedlbauer_config */ | 435 | } /* sedlbauer_config */ |
| 436 | 436 | ||
| @@ -493,7 +493,7 @@ static struct pcmcia_driver sedlbauer_driver = { | |||
| 493 | .drv = { | 493 | .drv = { |
| 494 | .name = "sedlbauer_cs", | 494 | .name = "sedlbauer_cs", |
| 495 | }, | 495 | }, |
| 496 | .probe = sedlbauer_attach, | 496 | .probe = sedlbauer_probe, |
| 497 | .remove = sedlbauer_detach, | 497 | .remove = sedlbauer_detach, |
| 498 | .id_table = sedlbauer_ids, | 498 | .id_table = sedlbauer_ids, |
| 499 | .suspend = sedlbauer_suspend, | 499 | .suspend = sedlbauer_suspend, |
diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c index 698e9ec95f0b..7b66038096f3 100644 --- a/drivers/isdn/hisax/teles_cs.c +++ b/drivers/isdn/hisax/teles_cs.c | |||
| @@ -75,7 +75,7 @@ module_param(protocol, int, 0); | |||
| 75 | handler. | 75 | handler. |
| 76 | */ | 76 | */ |
| 77 | 77 | ||
| 78 | static void teles_cs_config(struct pcmcia_device *link); | 78 | static int teles_cs_config(struct pcmcia_device *link); |
| 79 | static void teles_cs_release(struct pcmcia_device *link); | 79 | static void teles_cs_release(struct pcmcia_device *link); |
| 80 | 80 | ||
| 81 | /* | 81 | /* |
| @@ -130,7 +130,7 @@ typedef struct local_info_t { | |||
| 130 | 130 | ||
| 131 | ======================================================================*/ | 131 | ======================================================================*/ |
| 132 | 132 | ||
| 133 | static int teles_attach(struct pcmcia_device *link) | 133 | static int teles_probe(struct pcmcia_device *link) |
| 134 | { | 134 | { |
| 135 | local_info_t *local; | 135 | local_info_t *local; |
| 136 | 136 | ||
| @@ -165,9 +165,7 @@ static int teles_attach(struct pcmcia_device *link) | |||
| 165 | link->conf.IntType = INT_MEMORY_AND_IO; | 165 | link->conf.IntType = INT_MEMORY_AND_IO; |
| 166 | 166 | ||
| 167 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 167 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 168 | teles_cs_config(link); | 168 | return teles_cs_config(link); |
| 169 | |||
| 170 | return 0; | ||
| 171 | } /* teles_attach */ | 169 | } /* teles_attach */ |
| 172 | 170 | ||
| 173 | /*====================================================================== | 171 | /*====================================================================== |
| @@ -225,7 +223,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, | |||
| 225 | return get_tuple(handle, tuple, parse); | 223 | return get_tuple(handle, tuple, parse); |
| 226 | } | 224 | } |
| 227 | 225 | ||
| 228 | static void teles_cs_config(struct pcmcia_device *link) | 226 | static int teles_cs_config(struct pcmcia_device *link) |
| 229 | { | 227 | { |
| 230 | tuple_t tuple; | 228 | tuple_t tuple; |
| 231 | cisparse_t parse; | 229 | cisparse_t parse; |
| @@ -333,13 +331,16 @@ static void teles_cs_config(struct pcmcia_device *link) | |||
| 333 | printk(KERN_ERR "teles_cs: failed to initialize Teles PCMCIA %d at i/o %#x\n", | 331 | printk(KERN_ERR "teles_cs: failed to initialize Teles PCMCIA %d at i/o %#x\n", |
| 334 | i, link->io.BasePort1); | 332 | i, link->io.BasePort1); |
| 335 | teles_cs_release(link); | 333 | teles_cs_release(link); |
| 336 | } else | 334 | return -ENODEV; |
| 337 | ((local_info_t*)link->priv)->cardnr = i; | 335 | } |
| 336 | |||
| 337 | ((local_info_t*)link->priv)->cardnr = i; | ||
| 338 | return 0; | ||
| 338 | 339 | ||
| 339 | return; | ||
| 340 | cs_failed: | 340 | cs_failed: |
| 341 | cs_error(link, last_fn, i); | 341 | cs_error(link, last_fn, i); |
| 342 | teles_cs_release(link); | 342 | teles_cs_release(link); |
| 343 | return -ENODEV; | ||
| 343 | } /* teles_cs_config */ | 344 | } /* teles_cs_config */ |
| 344 | 345 | ||
| 345 | /*====================================================================== | 346 | /*====================================================================== |
| @@ -396,7 +397,7 @@ static struct pcmcia_driver teles_cs_driver = { | |||
| 396 | .drv = { | 397 | .drv = { |
| 397 | .name = "teles_cs", | 398 | .name = "teles_cs", |
| 398 | }, | 399 | }, |
| 399 | .probe = teles_attach, | 400 | .probe = teles_probe, |
| 400 | .remove = teles_detach, | 401 | .remove = teles_detach, |
| 401 | .id_table = teles_ids, | 402 | .id_table = teles_ids, |
| 402 | .suspend = teles_suspend, | 403 | .suspend = teles_suspend, |
diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c index e9086f0cb2fa..466f558aa7ed 100644 --- a/drivers/mtd/maps/pcmciamtd.c +++ b/drivers/mtd/maps/pcmciamtd.c | |||
| @@ -487,7 +487,7 @@ static void card_settings(struct pcmciamtd_dev *dev, struct pcmcia_device *link, | |||
| 487 | #define CS_CHECK(fn, ret) \ | 487 | #define CS_CHECK(fn, ret) \ |
| 488 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 488 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
| 489 | 489 | ||
| 490 | static void pcmciamtd_config(struct pcmcia_device *link) | 490 | static int pcmciamtd_config(struct pcmcia_device *link) |
| 491 | { | 491 | { |
| 492 | struct pcmciamtd_dev *dev = link->priv; | 492 | struct pcmciamtd_dev *dev = link->priv; |
| 493 | struct mtd_info *mtd = NULL; | 493 | struct mtd_info *mtd = NULL; |
| @@ -561,7 +561,7 @@ static void pcmciamtd_config(struct pcmcia_device *link) | |||
| 561 | if(!dev->win_size) { | 561 | if(!dev->win_size) { |
| 562 | err("Cant allocate memory window"); | 562 | err("Cant allocate memory window"); |
| 563 | pcmciamtd_release(link); | 563 | pcmciamtd_release(link); |
| 564 | return; | 564 | return -ENODEV; |
| 565 | } | 565 | } |
| 566 | DEBUG(1, "Allocated a window of %dKiB", dev->win_size >> 10); | 566 | DEBUG(1, "Allocated a window of %dKiB", dev->win_size >> 10); |
| 567 | 567 | ||
| @@ -573,7 +573,7 @@ static void pcmciamtd_config(struct pcmcia_device *link) | |||
| 573 | if(!dev->win_base) { | 573 | if(!dev->win_base) { |
| 574 | err("ioremap(%lu, %u) failed", req.Base, req.Size); | 574 | err("ioremap(%lu, %u) failed", req.Base, req.Size); |
| 575 | pcmciamtd_release(link); | 575 | pcmciamtd_release(link); |
| 576 | return; | 576 | return -ENODEV; |
| 577 | } | 577 | } |
| 578 | DEBUG(1, "mapped window dev = %p req.base = 0x%lx base = %p size = 0x%x", | 578 | DEBUG(1, "mapped window dev = %p req.base = 0x%lx base = %p size = 0x%x", |
| 579 | dev, req.Base, dev->win_base, req.Size); | 579 | dev, req.Base, dev->win_base, req.Size); |
| @@ -605,6 +605,7 @@ static void pcmciamtd_config(struct pcmcia_device *link) | |||
| 605 | ret = pcmcia_request_configuration(link, &link->conf); | 605 | ret = pcmcia_request_configuration(link, &link->conf); |
| 606 | if(ret != CS_SUCCESS) { | 606 | if(ret != CS_SUCCESS) { |
| 607 | cs_error(link, RequestConfiguration, ret); | 607 | cs_error(link, RequestConfiguration, ret); |
| 608 | return -ENODEV; | ||
| 608 | } | 609 | } |
| 609 | 610 | ||
| 610 | if(mem_type == 1) { | 611 | if(mem_type == 1) { |
| @@ -625,7 +626,7 @@ static void pcmciamtd_config(struct pcmcia_device *link) | |||
| 625 | if(!mtd) { | 626 | if(!mtd) { |
| 626 | DEBUG(1, "Cant find an MTD"); | 627 | DEBUG(1, "Cant find an MTD"); |
| 627 | pcmciamtd_release(link); | 628 | pcmciamtd_release(link); |
| 628 | return; | 629 | return -ENODEV; |
| 629 | } | 630 | } |
| 630 | 631 | ||
| 631 | dev->mtd_info = mtd; | 632 | dev->mtd_info = mtd; |
| @@ -668,19 +669,19 @@ static void pcmciamtd_config(struct pcmcia_device *link) | |||
| 668 | dev->mtd_info = NULL; | 669 | dev->mtd_info = NULL; |
| 669 | err("Couldnt register MTD device"); | 670 | err("Couldnt register MTD device"); |
| 670 | pcmciamtd_release(link); | 671 | pcmciamtd_release(link); |
| 671 | return; | 672 | return -ENODEV; |
| 672 | } | 673 | } |
| 673 | snprintf(dev->node.dev_name, sizeof(dev->node.dev_name), "mtd%d", mtd->index); | 674 | snprintf(dev->node.dev_name, sizeof(dev->node.dev_name), "mtd%d", mtd->index); |
| 674 | info("mtd%d: %s", mtd->index, mtd->name); | 675 | info("mtd%d: %s", mtd->index, mtd->name); |
| 675 | link->state &= ~DEV_CONFIG_PENDING; | 676 | link->state &= ~DEV_CONFIG_PENDING; |
| 676 | link->dev_node = &dev->node; | 677 | link->dev_node = &dev->node; |
| 677 | return; | 678 | return 0; |
| 678 | 679 | ||
| 679 | cs_failed: | 680 | cs_failed: |
| 680 | cs_error(link, last_fn, last_ret); | 681 | cs_error(link, last_fn, last_ret); |
| 681 | err("CS Error, exiting"); | 682 | err("CS Error, exiting"); |
| 682 | pcmciamtd_release(link); | 683 | pcmciamtd_release(link); |
| 683 | return; | 684 | return -ENODEV; |
| 684 | } | 685 | } |
| 685 | 686 | ||
| 686 | 687 | ||
| @@ -730,7 +731,7 @@ static void pcmciamtd_detach(struct pcmcia_device *link) | |||
| 730 | * with Card Services. | 731 | * with Card Services. |
| 731 | */ | 732 | */ |
| 732 | 733 | ||
| 733 | static int pcmciamtd_attach(struct pcmcia_device *link) | 734 | static int pcmciamtd_probe(struct pcmcia_device *link) |
| 734 | { | 735 | { |
| 735 | struct pcmciamtd_dev *dev; | 736 | struct pcmciamtd_dev *dev; |
| 736 | 737 | ||
| @@ -747,9 +748,7 @@ static int pcmciamtd_attach(struct pcmcia_device *link) | |||
| 747 | link->conf.IntType = INT_MEMORY; | 748 | link->conf.IntType = INT_MEMORY; |
| 748 | 749 | ||
| 749 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 750 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 750 | pcmciamtd_config(link); | 751 | return pcmciamtd_config(link); |
| 751 | |||
| 752 | return 0; | ||
| 753 | } | 752 | } |
| 754 | 753 | ||
| 755 | static struct pcmcia_device_id pcmciamtd_ids[] = { | 754 | static struct pcmcia_device_id pcmciamtd_ids[] = { |
| @@ -783,7 +782,7 @@ static struct pcmcia_driver pcmciamtd_driver = { | |||
| 783 | .drv = { | 782 | .drv = { |
| 784 | .name = "pcmciamtd" | 783 | .name = "pcmciamtd" |
| 785 | }, | 784 | }, |
| 786 | .probe = pcmciamtd_attach, | 785 | .probe = pcmciamtd_probe, |
| 787 | .remove = pcmciamtd_detach, | 786 | .remove = pcmciamtd_detach, |
| 788 | .owner = THIS_MODULE, | 787 | .owner = THIS_MODULE, |
| 789 | .id_table = pcmciamtd_ids, | 788 | .id_table = pcmciamtd_ids, |
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c index f4e293bd04dc..4611469fdff9 100644 --- a/drivers/net/pcmcia/3c574_cs.c +++ b/drivers/net/pcmcia/3c574_cs.c | |||
| @@ -225,7 +225,7 @@ static char mii_preamble_required = 0; | |||
| 225 | 225 | ||
| 226 | /* Index of functions. */ | 226 | /* Index of functions. */ |
| 227 | 227 | ||
| 228 | static void tc574_config(struct pcmcia_device *link); | 228 | static int tc574_config(struct pcmcia_device *link); |
| 229 | static void tc574_release(struct pcmcia_device *link); | 229 | static void tc574_release(struct pcmcia_device *link); |
| 230 | 230 | ||
| 231 | static void mdio_sync(kio_addr_t ioaddr, int bits); | 231 | static void mdio_sync(kio_addr_t ioaddr, int bits); |
| @@ -256,7 +256,7 @@ static void tc574_detach(struct pcmcia_device *p_dev); | |||
| 256 | with Card Services. | 256 | with Card Services. |
| 257 | */ | 257 | */ |
| 258 | 258 | ||
| 259 | static int tc574_attach(struct pcmcia_device *link) | 259 | static int tc574_probe(struct pcmcia_device *link) |
| 260 | { | 260 | { |
| 261 | struct el3_private *lp; | 261 | struct el3_private *lp; |
| 262 | struct net_device *dev; | 262 | struct net_device *dev; |
| @@ -297,9 +297,7 @@ static int tc574_attach(struct pcmcia_device *link) | |||
| 297 | #endif | 297 | #endif |
| 298 | 298 | ||
| 299 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 299 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 300 | tc574_config(link); | 300 | return tc574_config(link); |
| 301 | |||
| 302 | return 0; | ||
| 303 | } /* tc574_attach */ | 301 | } /* tc574_attach */ |
| 304 | 302 | ||
| 305 | /* | 303 | /* |
| @@ -337,7 +335,7 @@ static void tc574_detach(struct pcmcia_device *link) | |||
| 337 | 335 | ||
| 338 | static const char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"}; | 336 | static const char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"}; |
| 339 | 337 | ||
| 340 | static void tc574_config(struct pcmcia_device *link) | 338 | static int tc574_config(struct pcmcia_device *link) |
| 341 | { | 339 | { |
| 342 | struct net_device *dev = link->priv; | 340 | struct net_device *dev = link->priv; |
| 343 | struct el3_private *lp = netdev_priv(dev); | 341 | struct el3_private *lp = netdev_priv(dev); |
| @@ -486,13 +484,13 @@ static void tc574_config(struct pcmcia_device *link) | |||
| 486 | 8 << config.u.ram_size, ram_split[config.u.ram_split], | 484 | 8 << config.u.ram_size, ram_split[config.u.ram_split], |
| 487 | config.u.autoselect ? "autoselect " : ""); | 485 | config.u.autoselect ? "autoselect " : ""); |
| 488 | 486 | ||
| 489 | return; | 487 | return 0; |
| 490 | 488 | ||
| 491 | cs_failed: | 489 | cs_failed: |
| 492 | cs_error(link, last_fn, last_ret); | 490 | cs_error(link, last_fn, last_ret); |
| 493 | failed: | 491 | failed: |
| 494 | tc574_release(link); | 492 | tc574_release(link); |
| 495 | return; | 493 | return -ENODEV; |
| 496 | 494 | ||
| 497 | } /* tc574_config */ | 495 | } /* tc574_config */ |
| 498 | 496 | ||
| @@ -1223,7 +1221,7 @@ static struct pcmcia_driver tc574_driver = { | |||
| 1223 | .drv = { | 1221 | .drv = { |
| 1224 | .name = "3c574_cs", | 1222 | .name = "3c574_cs", |
| 1225 | }, | 1223 | }, |
| 1226 | .probe = tc574_attach, | 1224 | .probe = tc574_probe, |
| 1227 | .remove = tc574_detach, | 1225 | .remove = tc574_detach, |
| 1228 | .id_table = tc574_ids, | 1226 | .id_table = tc574_ids, |
| 1229 | .suspend = tc574_suspend, | 1227 | .suspend = tc574_suspend, |
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c index 565063d49334..160d48a8ed88 100644 --- a/drivers/net/pcmcia/3c589_cs.c +++ b/drivers/net/pcmcia/3c589_cs.c | |||
| @@ -142,7 +142,7 @@ DRV_NAME ".c " DRV_VERSION " 2001/10/13 00:08:50 (David Hinds)"; | |||
| 142 | 142 | ||
| 143 | /*====================================================================*/ | 143 | /*====================================================================*/ |
| 144 | 144 | ||
| 145 | static void tc589_config(struct pcmcia_device *link); | 145 | static int tc589_config(struct pcmcia_device *link); |
| 146 | static void tc589_release(struct pcmcia_device *link); | 146 | static void tc589_release(struct pcmcia_device *link); |
| 147 | 147 | ||
| 148 | static u16 read_eeprom(kio_addr_t ioaddr, int index); | 148 | static u16 read_eeprom(kio_addr_t ioaddr, int index); |
| @@ -170,7 +170,7 @@ static void tc589_detach(struct pcmcia_device *p_dev); | |||
| 170 | 170 | ||
| 171 | ======================================================================*/ | 171 | ======================================================================*/ |
| 172 | 172 | ||
| 173 | static int tc589_attach(struct pcmcia_device *link) | 173 | static int tc589_probe(struct pcmcia_device *link) |
| 174 | { | 174 | { |
| 175 | struct el3_private *lp; | 175 | struct el3_private *lp; |
| 176 | struct net_device *dev; | 176 | struct net_device *dev; |
| @@ -212,9 +212,7 @@ static int tc589_attach(struct pcmcia_device *link) | |||
| 212 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); | 212 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); |
| 213 | 213 | ||
| 214 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 214 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 215 | tc589_config(link); | 215 | return tc589_config(link); |
| 216 | |||
| 217 | return 0; | ||
| 218 | } /* tc589_attach */ | 216 | } /* tc589_attach */ |
| 219 | 217 | ||
| 220 | /*====================================================================== | 218 | /*====================================================================== |
| @@ -252,7 +250,7 @@ static void tc589_detach(struct pcmcia_device *link) | |||
| 252 | #define CS_CHECK(fn, ret) \ | 250 | #define CS_CHECK(fn, ret) \ |
| 253 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 251 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
| 254 | 252 | ||
| 255 | static void tc589_config(struct pcmcia_device *link) | 253 | static int tc589_config(struct pcmcia_device *link) |
| 256 | { | 254 | { |
| 257 | struct net_device *dev = link->priv; | 255 | struct net_device *dev = link->priv; |
| 258 | struct el3_private *lp = netdev_priv(dev); | 256 | struct el3_private *lp = netdev_priv(dev); |
| @@ -359,14 +357,13 @@ static void tc589_config(struct pcmcia_device *link) | |||
| 359 | printk(KERN_INFO " %dK FIFO split %s Rx:Tx, %s xcvr\n", | 357 | printk(KERN_INFO " %dK FIFO split %s Rx:Tx, %s xcvr\n", |
| 360 | (fifo & 7) ? 32 : 8, ram_split[(fifo >> 16) & 3], | 358 | (fifo & 7) ? 32 : 8, ram_split[(fifo >> 16) & 3], |
| 361 | if_names[dev->if_port]); | 359 | if_names[dev->if_port]); |
| 362 | return; | 360 | return 0; |
| 363 | 361 | ||
| 364 | cs_failed: | 362 | cs_failed: |
| 365 | cs_error(link, last_fn, last_ret); | 363 | cs_error(link, last_fn, last_ret); |
| 366 | failed: | 364 | failed: |
| 367 | tc589_release(link); | 365 | tc589_release(link); |
| 368 | return; | 366 | return -ENODEV; |
| 369 | |||
| 370 | } /* tc589_config */ | 367 | } /* tc589_config */ |
| 371 | 368 | ||
| 372 | /*====================================================================== | 369 | /*====================================================================== |
| @@ -997,7 +994,7 @@ static struct pcmcia_driver tc589_driver = { | |||
| 997 | .drv = { | 994 | .drv = { |
| 998 | .name = "3c589_cs", | 995 | .name = "3c589_cs", |
| 999 | }, | 996 | }, |
| 1000 | .probe = tc589_attach, | 997 | .probe = tc589_probe, |
| 1001 | .remove = tc589_detach, | 998 | .remove = tc589_detach, |
| 1002 | .id_table = tc589_ids, | 999 | .id_table = tc589_ids, |
| 1003 | .suspend = tc589_suspend, | 1000 | .suspend = tc589_suspend, |
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 88f180e98e81..f6ca85d77c7d 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
| @@ -86,7 +86,7 @@ static char *version = | |||
| 86 | 86 | ||
| 87 | /*====================================================================*/ | 87 | /*====================================================================*/ |
| 88 | 88 | ||
| 89 | static void axnet_config(struct pcmcia_device *link); | 89 | static int axnet_config(struct pcmcia_device *link); |
| 90 | static void axnet_release(struct pcmcia_device *link); | 90 | static void axnet_release(struct pcmcia_device *link); |
| 91 | static int axnet_open(struct net_device *dev); | 91 | static int axnet_open(struct net_device *dev); |
| 92 | static int axnet_close(struct net_device *dev); | 92 | static int axnet_close(struct net_device *dev); |
| @@ -142,7 +142,7 @@ static inline axnet_dev_t *PRIV(struct net_device *dev) | |||
| 142 | 142 | ||
| 143 | ======================================================================*/ | 143 | ======================================================================*/ |
| 144 | 144 | ||
| 145 | static int axnet_attach(struct pcmcia_device *link) | 145 | static int axnet_probe(struct pcmcia_device *link) |
| 146 | { | 146 | { |
| 147 | axnet_dev_t *info; | 147 | axnet_dev_t *info; |
| 148 | struct net_device *dev; | 148 | struct net_device *dev; |
| @@ -169,9 +169,7 @@ static int axnet_attach(struct pcmcia_device *link) | |||
| 169 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); | 169 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); |
| 170 | 170 | ||
| 171 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 171 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 172 | axnet_config(link); | 172 | return axnet_config(link); |
| 173 | |||
| 174 | return 0; | ||
| 175 | } /* axnet_attach */ | 173 | } /* axnet_attach */ |
| 176 | 174 | ||
| 177 | /*====================================================================== | 175 | /*====================================================================== |
| @@ -288,7 +286,7 @@ static int try_io_port(struct pcmcia_device *link) | |||
| 288 | } | 286 | } |
| 289 | } | 287 | } |
| 290 | 288 | ||
| 291 | static void axnet_config(struct pcmcia_device *link) | 289 | static int axnet_config(struct pcmcia_device *link) |
| 292 | { | 290 | { |
| 293 | struct net_device *dev = link->priv; | 291 | struct net_device *dev = link->priv; |
| 294 | axnet_dev_t *info = PRIV(dev); | 292 | axnet_dev_t *info = PRIV(dev); |
| @@ -425,14 +423,14 @@ static void axnet_config(struct pcmcia_device *link) | |||
| 425 | } else { | 423 | } else { |
| 426 | printk(KERN_NOTICE " No MII transceivers found!\n"); | 424 | printk(KERN_NOTICE " No MII transceivers found!\n"); |
| 427 | } | 425 | } |
| 428 | return; | 426 | return 0; |
| 429 | 427 | ||
| 430 | cs_failed: | 428 | cs_failed: |
| 431 | cs_error(link, last_fn, last_ret); | 429 | cs_error(link, last_fn, last_ret); |
| 432 | failed: | 430 | failed: |
| 433 | axnet_release(link); | 431 | axnet_release(link); |
| 434 | link->state &= ~DEV_CONFIG_PENDING; | 432 | link->state &= ~DEV_CONFIG_PENDING; |
| 435 | return; | 433 | return -ENODEV; |
| 436 | } /* axnet_config */ | 434 | } /* axnet_config */ |
| 437 | 435 | ||
| 438 | /*====================================================================== | 436 | /*====================================================================== |
| @@ -806,7 +804,7 @@ static struct pcmcia_driver axnet_cs_driver = { | |||
| 806 | .drv = { | 804 | .drv = { |
| 807 | .name = "axnet_cs", | 805 | .name = "axnet_cs", |
| 808 | }, | 806 | }, |
| 809 | .probe = axnet_attach, | 807 | .probe = axnet_probe, |
| 810 | .remove = axnet_detach, | 808 | .remove = axnet_detach, |
| 811 | .id_table = axnet_ids, | 809 | .id_table = axnet_ids, |
| 812 | .suspend = axnet_suspend, | 810 | .suspend = axnet_suspend, |
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c index a9bcfb4ba15e..a7d675bc6051 100644 --- a/drivers/net/pcmcia/com20020_cs.c +++ b/drivers/net/pcmcia/com20020_cs.c | |||
| @@ -118,7 +118,7 @@ MODULE_LICENSE("GPL"); | |||
| 118 | 118 | ||
| 119 | /*====================================================================*/ | 119 | /*====================================================================*/ |
| 120 | 120 | ||
| 121 | static void com20020_config(struct pcmcia_device *link); | 121 | static int com20020_config(struct pcmcia_device *link); |
| 122 | static void com20020_release(struct pcmcia_device *link); | 122 | static void com20020_release(struct pcmcia_device *link); |
| 123 | 123 | ||
| 124 | static void com20020_detach(struct pcmcia_device *p_dev); | 124 | static void com20020_detach(struct pcmcia_device *p_dev); |
| @@ -138,7 +138,7 @@ typedef struct com20020_dev_t { | |||
| 138 | 138 | ||
| 139 | ======================================================================*/ | 139 | ======================================================================*/ |
| 140 | 140 | ||
| 141 | static int com20020_attach(struct pcmcia_device *p_dev) | 141 | static int com20020_probe(struct pcmcia_device *p_dev) |
| 142 | { | 142 | { |
| 143 | com20020_dev_t *info; | 143 | com20020_dev_t *info; |
| 144 | struct net_device *dev; | 144 | struct net_device *dev; |
| @@ -179,9 +179,7 @@ static int com20020_attach(struct pcmcia_device *p_dev) | |||
| 179 | p_dev->priv = info; | 179 | p_dev->priv = info; |
| 180 | 180 | ||
| 181 | p_dev->state |= DEV_PRESENT; | 181 | p_dev->state |= DEV_PRESENT; |
| 182 | com20020_config(p_dev); | 182 | return com20020_config(p_dev); |
| 183 | |||
| 184 | return 0; | ||
| 185 | 183 | ||
| 186 | fail_alloc_dev: | 184 | fail_alloc_dev: |
| 187 | kfree(info); | 185 | kfree(info); |
| @@ -250,7 +248,7 @@ static void com20020_detach(struct pcmcia_device *link) | |||
| 250 | #define CS_CHECK(fn, ret) \ | 248 | #define CS_CHECK(fn, ret) \ |
| 251 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 249 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
| 252 | 250 | ||
| 253 | static void com20020_config(struct pcmcia_device *link) | 251 | static int com20020_config(struct pcmcia_device *link) |
| 254 | { | 252 | { |
| 255 | struct arcnet_local *lp; | 253 | struct arcnet_local *lp; |
| 256 | tuple_t tuple; | 254 | tuple_t tuple; |
| @@ -345,13 +343,14 @@ static void com20020_config(struct pcmcia_device *link) | |||
| 345 | 343 | ||
| 346 | DEBUG(1,KERN_INFO "%s: port %#3lx, irq %d\n", | 344 | DEBUG(1,KERN_INFO "%s: port %#3lx, irq %d\n", |
| 347 | dev->name, dev->base_addr, dev->irq); | 345 | dev->name, dev->base_addr, dev->irq); |
| 348 | return; | 346 | return 0; |
| 349 | 347 | ||
| 350 | cs_failed: | 348 | cs_failed: |
| 351 | cs_error(link, last_fn, last_ret); | 349 | cs_error(link, last_fn, last_ret); |
| 352 | failed: | 350 | failed: |
| 353 | DEBUG(1,"com20020_config failed...\n"); | 351 | DEBUG(1,"com20020_config failed...\n"); |
| 354 | com20020_release(link); | 352 | com20020_release(link); |
| 353 | return -ENODEV; | ||
| 355 | } /* com20020_config */ | 354 | } /* com20020_config */ |
| 356 | 355 | ||
| 357 | /*====================================================================== | 356 | /*====================================================================== |
| @@ -404,7 +403,7 @@ static struct pcmcia_driver com20020_cs_driver = { | |||
| 404 | .drv = { | 403 | .drv = { |
| 405 | .name = "com20020_cs", | 404 | .name = "com20020_cs", |
| 406 | }, | 405 | }, |
| 407 | .probe = com20020_attach, | 406 | .probe = com20020_probe, |
| 408 | .remove = com20020_detach, | 407 | .remove = com20020_detach, |
| 409 | .id_table = com20020_ids, | 408 | .id_table = com20020_ids, |
| 410 | .suspend = com20020_suspend, | 409 | .suspend = com20020_suspend, |
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c index ad3e490bb016..d9c83b290095 100644 --- a/drivers/net/pcmcia/fmvj18x_cs.c +++ b/drivers/net/pcmcia/fmvj18x_cs.c | |||
| @@ -84,7 +84,7 @@ static char *version = DRV_NAME ".c " DRV_VERSION " 2002/03/23"; | |||
| 84 | /* | 84 | /* |
| 85 | PCMCIA event handlers | 85 | PCMCIA event handlers |
| 86 | */ | 86 | */ |
| 87 | static void fmvj18x_config(struct pcmcia_device *link); | 87 | static int fmvj18x_config(struct pcmcia_device *link); |
| 88 | static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id); | 88 | static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id); |
| 89 | static int fmvj18x_setup_mfc(struct pcmcia_device *link); | 89 | static int fmvj18x_setup_mfc(struct pcmcia_device *link); |
| 90 | static void fmvj18x_release(struct pcmcia_device *link); | 90 | static void fmvj18x_release(struct pcmcia_device *link); |
| @@ -228,7 +228,7 @@ typedef struct local_info_t { | |||
| 228 | #define BANK_1U 0x24 /* bank 1 (CONFIG_1) */ | 228 | #define BANK_1U 0x24 /* bank 1 (CONFIG_1) */ |
| 229 | #define BANK_2U 0x28 /* bank 2 (CONFIG_1) */ | 229 | #define BANK_2U 0x28 /* bank 2 (CONFIG_1) */ |
| 230 | 230 | ||
| 231 | static int fmvj18x_attach(struct pcmcia_device *link) | 231 | static int fmvj18x_probe(struct pcmcia_device *link) |
| 232 | { | 232 | { |
| 233 | local_info_t *lp; | 233 | local_info_t *lp; |
| 234 | struct net_device *dev; | 234 | struct net_device *dev; |
| @@ -273,9 +273,7 @@ static int fmvj18x_attach(struct pcmcia_device *link) | |||
| 273 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); | 273 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); |
| 274 | 274 | ||
| 275 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 275 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 276 | fmvj18x_config(link); | 276 | return fmvj18x_config(link); |
| 277 | |||
| 278 | return 0; | ||
| 279 | } /* fmvj18x_attach */ | 277 | } /* fmvj18x_attach */ |
| 280 | 278 | ||
| 281 | /*====================================================================*/ | 279 | /*====================================================================*/ |
| @@ -339,7 +337,7 @@ static int ungermann_try_io_port(struct pcmcia_device *link) | |||
| 339 | return ret; /* RequestIO failed */ | 337 | return ret; /* RequestIO failed */ |
| 340 | } | 338 | } |
| 341 | 339 | ||
| 342 | static void fmvj18x_config(struct pcmcia_device *link) | 340 | static int fmvj18x_config(struct pcmcia_device *link) |
| 343 | { | 341 | { |
| 344 | struct net_device *dev = link->priv; | 342 | struct net_device *dev = link->priv; |
| 345 | local_info_t *lp = netdev_priv(dev); | 343 | local_info_t *lp = netdev_priv(dev); |
| @@ -552,7 +550,7 @@ static void fmvj18x_config(struct pcmcia_device *link) | |||
| 552 | for (i = 0; i < 6; i++) | 550 | for (i = 0; i < 6; i++) |
| 553 | printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n")); | 551 | printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n")); |
| 554 | 552 | ||
| 555 | return; | 553 | return 0; |
| 556 | 554 | ||
| 557 | cs_failed: | 555 | cs_failed: |
| 558 | /* All Card Services errors end up here */ | 556 | /* All Card Services errors end up here */ |
| @@ -560,7 +558,7 @@ cs_failed: | |||
| 560 | failed: | 558 | failed: |
| 561 | fmvj18x_release(link); | 559 | fmvj18x_release(link); |
| 562 | link->state &= ~DEV_CONFIG_PENDING; | 560 | link->state &= ~DEV_CONFIG_PENDING; |
| 563 | 561 | return -ENODEV; | |
| 564 | } /* fmvj18x_config */ | 562 | } /* fmvj18x_config */ |
| 565 | /*====================================================================*/ | 563 | /*====================================================================*/ |
| 566 | 564 | ||
| @@ -720,7 +718,7 @@ static struct pcmcia_driver fmvj18x_cs_driver = { | |||
| 720 | .drv = { | 718 | .drv = { |
| 721 | .name = "fmvj18x_cs", | 719 | .name = "fmvj18x_cs", |
| 722 | }, | 720 | }, |
| 723 | .probe = fmvj18x_attach, | 721 | .probe = fmvj18x_probe, |
| 724 | .remove = fmvj18x_detach, | 722 | .remove = fmvj18x_detach, |
| 725 | .id_table = fmvj18x_ids, | 723 | .id_table = fmvj18x_ids, |
| 726 | .suspend = fmvj18x_suspend, | 724 | .suspend = fmvj18x_suspend, |
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c index 1b8b44dc4c50..e038d9278a59 100644 --- a/drivers/net/pcmcia/ibmtr_cs.c +++ b/drivers/net/pcmcia/ibmtr_cs.c | |||
| @@ -105,7 +105,7 @@ MODULE_LICENSE("GPL"); | |||
| 105 | 105 | ||
| 106 | /*====================================================================*/ | 106 | /*====================================================================*/ |
| 107 | 107 | ||
| 108 | static void ibmtr_config(struct pcmcia_device *link); | 108 | static int ibmtr_config(struct pcmcia_device *link); |
| 109 | static void ibmtr_hw_setup(struct net_device *dev, u_int mmiobase); | 109 | static void ibmtr_hw_setup(struct net_device *dev, u_int mmiobase); |
| 110 | static void ibmtr_release(struct pcmcia_device *link); | 110 | static void ibmtr_release(struct pcmcia_device *link); |
| 111 | static void ibmtr_detach(struct pcmcia_device *p_dev); | 111 | static void ibmtr_detach(struct pcmcia_device *p_dev); |
| @@ -174,9 +174,7 @@ static int ibmtr_attach(struct pcmcia_device *link) | |||
| 174 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); | 174 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); |
| 175 | 175 | ||
| 176 | link->state |= DEV_PRESENT; | 176 | link->state |= DEV_PRESENT; |
| 177 | ibmtr_config(link); | 177 | return ibmtr_config(link); |
| 178 | |||
| 179 | return 0; | ||
| 180 | } /* ibmtr_attach */ | 178 | } /* ibmtr_attach */ |
| 181 | 179 | ||
| 182 | /*====================================================================== | 180 | /*====================================================================== |
| @@ -220,7 +218,7 @@ static void ibmtr_detach(struct pcmcia_device *link) | |||
| 220 | #define CS_CHECK(fn, ret) \ | 218 | #define CS_CHECK(fn, ret) \ |
| 221 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 219 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
| 222 | 220 | ||
| 223 | static void ibmtr_config(struct pcmcia_device *link) | 221 | static int ibmtr_config(struct pcmcia_device *link) |
| 224 | { | 222 | { |
| 225 | ibmtr_dev_t *info = link->priv; | 223 | ibmtr_dev_t *info = link->priv; |
| 226 | struct net_device *dev = info->dev; | 224 | struct net_device *dev = info->dev; |
| @@ -323,12 +321,13 @@ static void ibmtr_config(struct pcmcia_device *link) | |||
| 323 | for (i = 0; i < TR_ALEN; i++) | 321 | for (i = 0; i < TR_ALEN; i++) |
| 324 | printk("%02X", dev->dev_addr[i]); | 322 | printk("%02X", dev->dev_addr[i]); |
| 325 | printk("\n"); | 323 | printk("\n"); |
| 326 | return; | 324 | return 0; |
| 327 | 325 | ||
| 328 | cs_failed: | 326 | cs_failed: |
| 329 | cs_error(link, last_fn, last_ret); | 327 | cs_error(link, last_fn, last_ret); |
| 330 | failed: | 328 | failed: |
| 331 | ibmtr_release(link); | 329 | ibmtr_release(link); |
| 330 | return -ENODEV; | ||
| 332 | } /* ibmtr_config */ | 331 | } /* ibmtr_config */ |
| 333 | 332 | ||
| 334 | /*====================================================================== | 333 | /*====================================================================== |
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c index 8b8e7162314c..ea8a62e629a4 100644 --- a/drivers/net/pcmcia/nmclan_cs.c +++ b/drivers/net/pcmcia/nmclan_cs.c | |||
| @@ -417,7 +417,7 @@ INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG); | |||
| 417 | Function Prototypes | 417 | Function Prototypes |
| 418 | ---------------------------------------------------------------------------- */ | 418 | ---------------------------------------------------------------------------- */ |
| 419 | 419 | ||
| 420 | static void nmclan_config(struct pcmcia_device *link); | 420 | static int nmclan_config(struct pcmcia_device *link); |
| 421 | static void nmclan_release(struct pcmcia_device *link); | 421 | static void nmclan_release(struct pcmcia_device *link); |
| 422 | 422 | ||
| 423 | static void nmclan_reset(struct net_device *dev); | 423 | static void nmclan_reset(struct net_device *dev); |
| @@ -443,7 +443,7 @@ nmclan_attach | |||
| 443 | Services. | 443 | Services. |
| 444 | ---------------------------------------------------------------------------- */ | 444 | ---------------------------------------------------------------------------- */ |
| 445 | 445 | ||
| 446 | static int nmclan_attach(struct pcmcia_device *link) | 446 | static int nmclan_probe(struct pcmcia_device *link) |
| 447 | { | 447 | { |
| 448 | mace_private *lp; | 448 | mace_private *lp; |
| 449 | struct net_device *dev; | 449 | struct net_device *dev; |
| @@ -488,9 +488,7 @@ static int nmclan_attach(struct pcmcia_device *link) | |||
| 488 | #endif | 488 | #endif |
| 489 | 489 | ||
| 490 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 490 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 491 | nmclan_config(link); | 491 | return nmclan_config(link); |
| 492 | |||
| 493 | return 0; | ||
| 494 | } /* nmclan_attach */ | 492 | } /* nmclan_attach */ |
| 495 | 493 | ||
| 496 | /* ---------------------------------------------------------------------------- | 494 | /* ---------------------------------------------------------------------------- |
| @@ -655,7 +653,7 @@ nmclan_config | |||
| 655 | #define CS_CHECK(fn, ret) \ | 653 | #define CS_CHECK(fn, ret) \ |
| 656 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 654 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
| 657 | 655 | ||
| 658 | static void nmclan_config(struct pcmcia_device *link) | 656 | static int nmclan_config(struct pcmcia_device *link) |
| 659 | { | 657 | { |
| 660 | struct net_device *dev = link->priv; | 658 | struct net_device *dev = link->priv; |
| 661 | mace_private *lp = netdev_priv(dev); | 659 | mace_private *lp = netdev_priv(dev); |
| @@ -710,7 +708,7 @@ static void nmclan_config(struct pcmcia_device *link) | |||
| 710 | printk(KERN_NOTICE "nmclan_cs: mace id not found: %x %x should" | 708 | printk(KERN_NOTICE "nmclan_cs: mace id not found: %x %x should" |
| 711 | " be 0x40 0x?9\n", sig[0], sig[1]); | 709 | " be 0x40 0x?9\n", sig[0], sig[1]); |
| 712 | link->state &= ~DEV_CONFIG_PENDING; | 710 | link->state &= ~DEV_CONFIG_PENDING; |
| 713 | return; | 711 | return -ENODEV; |
| 714 | } | 712 | } |
| 715 | } | 713 | } |
| 716 | 714 | ||
| @@ -740,14 +738,13 @@ static void nmclan_config(struct pcmcia_device *link) | |||
| 740 | dev->name, dev->base_addr, dev->irq, if_names[dev->if_port]); | 738 | dev->name, dev->base_addr, dev->irq, if_names[dev->if_port]); |
| 741 | for (i = 0; i < 6; i++) | 739 | for (i = 0; i < 6; i++) |
| 742 | printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n")); | 740 | printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n")); |
| 743 | return; | 741 | return 0; |
| 744 | 742 | ||
| 745 | cs_failed: | 743 | cs_failed: |
| 746 | cs_error(link, last_fn, last_ret); | 744 | cs_error(link, last_fn, last_ret); |
| 747 | failed: | 745 | failed: |
| 748 | nmclan_release(link); | 746 | nmclan_release(link); |
| 749 | return; | 747 | return -ENODEV; |
| 750 | |||
| 751 | } /* nmclan_config */ | 748 | } /* nmclan_config */ |
| 752 | 749 | ||
| 753 | /* ---------------------------------------------------------------------------- | 750 | /* ---------------------------------------------------------------------------- |
| @@ -1611,7 +1608,7 @@ static struct pcmcia_driver nmclan_cs_driver = { | |||
| 1611 | .drv = { | 1608 | .drv = { |
| 1612 | .name = "nmclan_cs", | 1609 | .name = "nmclan_cs", |
| 1613 | }, | 1610 | }, |
| 1614 | .probe = nmclan_attach, | 1611 | .probe = nmclan_probe, |
| 1615 | .remove = nmclan_detach, | 1612 | .remove = nmclan_detach, |
| 1616 | .id_table = nmclan_ids, | 1613 | .id_table = nmclan_ids, |
| 1617 | .suspend = nmclan_suspend, | 1614 | .suspend = nmclan_suspend, |
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index 9f41355e6beb..d840c0f03ea9 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
| @@ -103,7 +103,7 @@ module_param_array(hw_addr, int, NULL, 0); | |||
| 103 | /*====================================================================*/ | 103 | /*====================================================================*/ |
| 104 | 104 | ||
| 105 | static void mii_phy_probe(struct net_device *dev); | 105 | static void mii_phy_probe(struct net_device *dev); |
| 106 | static void pcnet_config(struct pcmcia_device *link); | 106 | static int pcnet_config(struct pcmcia_device *link); |
| 107 | static void pcnet_release(struct pcmcia_device *link); | 107 | static void pcnet_release(struct pcmcia_device *link); |
| 108 | static int pcnet_open(struct net_device *dev); | 108 | static int pcnet_open(struct net_device *dev); |
| 109 | static int pcnet_close(struct net_device *dev); | 109 | static int pcnet_close(struct net_device *dev); |
| @@ -265,9 +265,7 @@ static int pcnet_probe(struct pcmcia_device *link) | |||
| 265 | dev->set_config = &set_config; | 265 | dev->set_config = &set_config; |
| 266 | 266 | ||
| 267 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 267 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 268 | pcnet_config(link); | 268 | return pcnet_config(link); |
| 269 | |||
| 270 | return 0; | ||
| 271 | } /* pcnet_attach */ | 269 | } /* pcnet_attach */ |
| 272 | 270 | ||
| 273 | /*====================================================================== | 271 | /*====================================================================== |
| @@ -516,7 +514,7 @@ static int try_io_port(struct pcmcia_device *link) | |||
| 516 | } | 514 | } |
| 517 | } | 515 | } |
| 518 | 516 | ||
| 519 | static void pcnet_config(struct pcmcia_device *link) | 517 | static int pcnet_config(struct pcmcia_device *link) |
| 520 | { | 518 | { |
| 521 | struct net_device *dev = link->priv; | 519 | struct net_device *dev = link->priv; |
| 522 | pcnet_dev_t *info = PRIV(dev); | 520 | pcnet_dev_t *info = PRIV(dev); |
| @@ -701,14 +699,14 @@ static void pcnet_config(struct pcmcia_device *link) | |||
| 701 | printk(" hw_addr "); | 699 | printk(" hw_addr "); |
| 702 | for (i = 0; i < 6; i++) | 700 | for (i = 0; i < 6; i++) |
| 703 | printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n")); | 701 | printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n")); |
| 704 | return; | 702 | return 0; |
| 705 | 703 | ||
| 706 | cs_failed: | 704 | cs_failed: |
| 707 | cs_error(link, last_fn, last_ret); | 705 | cs_error(link, last_fn, last_ret); |
| 708 | failed: | 706 | failed: |
| 709 | pcnet_release(link); | 707 | pcnet_release(link); |
| 710 | link->state &= ~DEV_CONFIG_PENDING; | 708 | link->state &= ~DEV_CONFIG_PENDING; |
| 711 | return; | 709 | return -ENODEV; |
| 712 | } /* pcnet_config */ | 710 | } /* pcnet_config */ |
| 713 | 711 | ||
| 714 | /*====================================================================== | 712 | /*====================================================================== |
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index a4ee3057b831..3252c1dc9ee7 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c | |||
| @@ -279,7 +279,7 @@ enum RxCfg { RxAllMulti = 0x0004, RxPromisc = 0x0002, | |||
| 279 | /*====================================================================*/ | 279 | /*====================================================================*/ |
| 280 | 280 | ||
| 281 | static void smc91c92_detach(struct pcmcia_device *p_dev); | 281 | static void smc91c92_detach(struct pcmcia_device *p_dev); |
| 282 | static void smc91c92_config(struct pcmcia_device *link); | 282 | static int smc91c92_config(struct pcmcia_device *link); |
| 283 | static void smc91c92_release(struct pcmcia_device *link); | 283 | static void smc91c92_release(struct pcmcia_device *link); |
| 284 | 284 | ||
| 285 | static int smc_open(struct net_device *dev); | 285 | static int smc_open(struct net_device *dev); |
| @@ -309,7 +309,7 @@ static struct ethtool_ops ethtool_ops; | |||
| 309 | 309 | ||
| 310 | ======================================================================*/ | 310 | ======================================================================*/ |
| 311 | 311 | ||
| 312 | static int smc91c92_attach(struct pcmcia_device *link) | 312 | static int smc91c92_probe(struct pcmcia_device *link) |
| 313 | { | 313 | { |
| 314 | struct smc_private *smc; | 314 | struct smc_private *smc; |
| 315 | struct net_device *dev; | 315 | struct net_device *dev; |
| @@ -357,9 +357,7 @@ static int smc91c92_attach(struct pcmcia_device *link) | |||
| 357 | smc->mii_if.reg_num_mask = 0x1f; | 357 | smc->mii_if.reg_num_mask = 0x1f; |
| 358 | 358 | ||
| 359 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 359 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 360 | smc91c92_config(link); | 360 | return smc91c92_config(link); |
| 361 | |||
| 362 | return 0; | ||
| 363 | } /* smc91c92_attach */ | 361 | } /* smc91c92_attach */ |
| 364 | 362 | ||
| 365 | /*====================================================================== | 363 | /*====================================================================== |
| @@ -972,7 +970,7 @@ static int check_sig(struct pcmcia_device *link) | |||
| 972 | #define CS_EXIT_TEST(ret, svc, label) \ | 970 | #define CS_EXIT_TEST(ret, svc, label) \ |
| 973 | if (ret != CS_SUCCESS) { cs_error(link, svc, ret); goto label; } | 971 | if (ret != CS_SUCCESS) { cs_error(link, svc, ret); goto label; } |
| 974 | 972 | ||
| 975 | static void smc91c92_config(struct pcmcia_device *link) | 973 | static int smc91c92_config(struct pcmcia_device *link) |
| 976 | { | 974 | { |
| 977 | struct net_device *dev = link->priv; | 975 | struct net_device *dev = link->priv; |
| 978 | struct smc_private *smc = netdev_priv(dev); | 976 | struct smc_private *smc = netdev_priv(dev); |
| @@ -1145,7 +1143,7 @@ static void smc91c92_config(struct pcmcia_device *link) | |||
| 1145 | } | 1143 | } |
| 1146 | } | 1144 | } |
| 1147 | kfree(cfg_mem); | 1145 | kfree(cfg_mem); |
| 1148 | return; | 1146 | return 0; |
| 1149 | 1147 | ||
| 1150 | config_undo: | 1148 | config_undo: |
| 1151 | unregister_netdev(dev); | 1149 | unregister_netdev(dev); |
| @@ -1153,7 +1151,7 @@ config_failed: /* CS_EXIT_TEST() calls jump to here... */ | |||
| 1153 | smc91c92_release(link); | 1151 | smc91c92_release(link); |
| 1154 | link->state &= ~DEV_CONFIG_PENDING; | 1152 | link->state &= ~DEV_CONFIG_PENDING; |
| 1155 | kfree(cfg_mem); | 1153 | kfree(cfg_mem); |
| 1156 | 1154 | return -ENODEV; | |
| 1157 | } /* smc91c92_config */ | 1155 | } /* smc91c92_config */ |
| 1158 | 1156 | ||
| 1159 | /*====================================================================== | 1157 | /*====================================================================== |
| @@ -2289,7 +2287,7 @@ static struct pcmcia_driver smc91c92_cs_driver = { | |||
| 2289 | .drv = { | 2287 | .drv = { |
| 2290 | .name = "smc91c92_cs", | 2288 | .name = "smc91c92_cs", |
| 2291 | }, | 2289 | }, |
| 2292 | .probe = smc91c92_attach, | 2290 | .probe = smc91c92_probe, |
| 2293 | .remove = smc91c92_detach, | 2291 | .remove = smc91c92_detach, |
| 2294 | .id_table = smc91c92_ids, | 2292 | .id_table = smc91c92_ids, |
| 2295 | .suspend = smc91c92_suspend, | 2293 | .suspend = smc91c92_suspend, |
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c index 84328da075c3..77bf4e3a6139 100644 --- a/drivers/net/pcmcia/xirc2ps_cs.c +++ b/drivers/net/pcmcia/xirc2ps_cs.c | |||
| @@ -290,7 +290,7 @@ static void mii_wr(kio_addr_t ioaddr, u_char phyaddr, u_char phyreg, | |||
| 290 | */ | 290 | */ |
| 291 | 291 | ||
| 292 | static int has_ce2_string(struct pcmcia_device * link); | 292 | static int has_ce2_string(struct pcmcia_device * link); |
| 293 | static void xirc2ps_config(struct pcmcia_device * link); | 293 | static int xirc2ps_config(struct pcmcia_device * link); |
| 294 | static void xirc2ps_release(struct pcmcia_device * link); | 294 | static void xirc2ps_release(struct pcmcia_device * link); |
| 295 | 295 | ||
| 296 | /**************** | 296 | /**************** |
| @@ -553,7 +553,7 @@ mii_wr(kio_addr_t ioaddr, u_char phyaddr, u_char phyreg, unsigned data, int len) | |||
| 553 | */ | 553 | */ |
| 554 | 554 | ||
| 555 | static int | 555 | static int |
| 556 | xirc2ps_attach(struct pcmcia_device *link) | 556 | xirc2ps_probe(struct pcmcia_device *link) |
| 557 | { | 557 | { |
| 558 | struct net_device *dev; | 558 | struct net_device *dev; |
| 559 | local_info_t *local; | 559 | local_info_t *local; |
| @@ -592,9 +592,7 @@ xirc2ps_attach(struct pcmcia_device *link) | |||
| 592 | #endif | 592 | #endif |
| 593 | 593 | ||
| 594 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 594 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 595 | xirc2ps_config(link); | 595 | return xirc2ps_config(link); |
| 596 | |||
| 597 | return 0; | ||
| 598 | } /* xirc2ps_attach */ | 596 | } /* xirc2ps_attach */ |
| 599 | 597 | ||
| 600 | /**************** | 598 | /**************** |
| @@ -731,7 +729,7 @@ has_ce2_string(struct pcmcia_device * link) | |||
| 731 | * is received, to configure the PCMCIA socket, and to make the | 729 | * is received, to configure the PCMCIA socket, and to make the |
| 732 | * ethernet device available to the system. | 730 | * ethernet device available to the system. |
| 733 | */ | 731 | */ |
| 734 | static void | 732 | static int |
| 735 | xirc2ps_config(struct pcmcia_device * link) | 733 | xirc2ps_config(struct pcmcia_device * link) |
| 736 | { | 734 | { |
| 737 | struct net_device *dev = link->priv; | 735 | struct net_device *dev = link->priv; |
| @@ -1061,17 +1059,18 @@ xirc2ps_config(struct pcmcia_device * link) | |||
| 1061 | printk("%c%02X", i?':':' ', dev->dev_addr[i]); | 1059 | printk("%c%02X", i?':':' ', dev->dev_addr[i]); |
| 1062 | printk("\n"); | 1060 | printk("\n"); |
| 1063 | 1061 | ||
| 1064 | return; | 1062 | return 0; |
| 1065 | 1063 | ||
| 1066 | config_error: | 1064 | config_error: |
| 1067 | link->state &= ~DEV_CONFIG_PENDING; | 1065 | link->state &= ~DEV_CONFIG_PENDING; |
| 1068 | xirc2ps_release(link); | 1066 | xirc2ps_release(link); |
| 1069 | return; | 1067 | return -ENODEV; |
| 1070 | 1068 | ||
| 1071 | cis_error: | 1069 | cis_error: |
| 1072 | printk(KNOT_XIRC "unable to parse CIS\n"); | 1070 | printk(KNOT_XIRC "unable to parse CIS\n"); |
| 1073 | failure: | 1071 | failure: |
| 1074 | link->state &= ~DEV_CONFIG_PENDING; | 1072 | link->state &= ~DEV_CONFIG_PENDING; |
| 1073 | return -ENODEV; | ||
| 1075 | } /* xirc2ps_config */ | 1074 | } /* xirc2ps_config */ |
| 1076 | 1075 | ||
| 1077 | /**************** | 1076 | /**************** |
| @@ -1911,7 +1910,7 @@ static struct pcmcia_driver xirc2ps_cs_driver = { | |||
| 1911 | .drv = { | 1910 | .drv = { |
| 1912 | .name = "xirc2ps_cs", | 1911 | .name = "xirc2ps_cs", |
| 1913 | }, | 1912 | }, |
| 1914 | .probe = xirc2ps_attach, | 1913 | .probe = xirc2ps_probe, |
| 1915 | .remove = xirc2ps_detach, | 1914 | .remove = xirc2ps_detach, |
| 1916 | .id_table = xirc2ps_ids, | 1915 | .id_table = xirc2ps_ids, |
| 1917 | .suspend = xirc2ps_suspend, | 1916 | .suspend = xirc2ps_suspend, |
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c index 76970197f98f..97f41565fca8 100644 --- a/drivers/net/wireless/airo_cs.c +++ b/drivers/net/wireless/airo_cs.c | |||
| @@ -80,7 +80,7 @@ MODULE_SUPPORTED_DEVICE("Aironet 4500, 4800 and Cisco 340 PCMCIA cards"); | |||
| 80 | event handler. | 80 | event handler. |
| 81 | */ | 81 | */ |
| 82 | 82 | ||
| 83 | static void airo_config(struct pcmcia_device *link); | 83 | static int airo_config(struct pcmcia_device *link); |
| 84 | static void airo_release(struct pcmcia_device *link); | 84 | static void airo_release(struct pcmcia_device *link); |
| 85 | 85 | ||
| 86 | /* | 86 | /* |
| @@ -141,7 +141,7 @@ typedef struct local_info_t { | |||
| 141 | 141 | ||
| 142 | ======================================================================*/ | 142 | ======================================================================*/ |
| 143 | 143 | ||
| 144 | static int airo_attach(struct pcmcia_device *p_dev) | 144 | static int airo_probe(struct pcmcia_device *p_dev) |
| 145 | { | 145 | { |
| 146 | local_info_t *local; | 146 | local_info_t *local; |
| 147 | 147 | ||
| @@ -171,9 +171,7 @@ static int airo_attach(struct pcmcia_device *p_dev) | |||
| 171 | p_dev->priv = local; | 171 | p_dev->priv = local; |
| 172 | 172 | ||
| 173 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 173 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 174 | airo_config(p_dev); | 174 | return airo_config(p_dev); |
| 175 | |||
| 176 | return 0; | ||
| 177 | } /* airo_attach */ | 175 | } /* airo_attach */ |
| 178 | 176 | ||
| 179 | /*====================================================================== | 177 | /*====================================================================== |
| @@ -211,7 +209,7 @@ static void airo_detach(struct pcmcia_device *link) | |||
| 211 | #define CS_CHECK(fn, ret) \ | 209 | #define CS_CHECK(fn, ret) \ |
| 212 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 210 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
| 213 | 211 | ||
| 214 | static void airo_config(struct pcmcia_device *link) | 212 | static int airo_config(struct pcmcia_device *link) |
| 215 | { | 213 | { |
| 216 | tuple_t tuple; | 214 | tuple_t tuple; |
| 217 | cisparse_t parse; | 215 | cisparse_t parse; |
| @@ -386,12 +384,12 @@ static void airo_config(struct pcmcia_device *link) | |||
| 386 | printk("\n"); | 384 | printk("\n"); |
| 387 | 385 | ||
| 388 | link->state &= ~DEV_CONFIG_PENDING; | 386 | link->state &= ~DEV_CONFIG_PENDING; |
| 389 | return; | 387 | return 0; |
| 390 | 388 | ||
| 391 | cs_failed: | 389 | cs_failed: |
| 392 | cs_error(link, last_fn, last_ret); | 390 | cs_error(link, last_fn, last_ret); |
| 393 | airo_release(link); | 391 | airo_release(link); |
| 394 | 392 | return -ENODEV; | |
| 395 | } /* airo_config */ | 393 | } /* airo_config */ |
| 396 | 394 | ||
| 397 | /*====================================================================== | 395 | /*====================================================================== |
| @@ -444,7 +442,7 @@ static struct pcmcia_driver airo_driver = { | |||
| 444 | .drv = { | 442 | .drv = { |
| 445 | .name = "airo_cs", | 443 | .name = "airo_cs", |
| 446 | }, | 444 | }, |
| 447 | .probe = airo_attach, | 445 | .probe = airo_probe, |
| 448 | .remove = airo_detach, | 446 | .remove = airo_detach, |
| 449 | .id_table = airo_ids, | 447 | .id_table = airo_ids, |
| 450 | .suspend = airo_suspend, | 448 | .suspend = airo_suspend, |
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c index 843dd1a036d2..962272c1342a 100644 --- a/drivers/net/wireless/atmel_cs.c +++ b/drivers/net/wireless/atmel_cs.c | |||
| @@ -91,7 +91,7 @@ MODULE_SUPPORTED_DEVICE("Atmel at76c50x PCMCIA cards"); | |||
| 91 | event handler. | 91 | event handler. |
| 92 | */ | 92 | */ |
| 93 | 93 | ||
| 94 | static void atmel_config(struct pcmcia_device *link); | 94 | static int atmel_config(struct pcmcia_device *link); |
| 95 | static void atmel_release(struct pcmcia_device *link); | 95 | static void atmel_release(struct pcmcia_device *link); |
| 96 | 96 | ||
| 97 | /* | 97 | /* |
| @@ -152,7 +152,7 @@ typedef struct local_info_t { | |||
| 152 | 152 | ||
| 153 | ======================================================================*/ | 153 | ======================================================================*/ |
| 154 | 154 | ||
| 155 | static int atmel_attach(struct pcmcia_device *p_dev) | 155 | static int atmel_probe(struct pcmcia_device *p_dev) |
| 156 | { | 156 | { |
| 157 | local_info_t *local; | 157 | local_info_t *local; |
| 158 | 158 | ||
| @@ -182,9 +182,7 @@ static int atmel_attach(struct pcmcia_device *p_dev) | |||
| 182 | p_dev->priv = local; | 182 | p_dev->priv = local; |
| 183 | 183 | ||
| 184 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 184 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 185 | atmel_config(p_dev); | 185 | return atmel_config(p_dev); |
| 186 | |||
| 187 | return 0; | ||
| 188 | } /* atmel_attach */ | 186 | } /* atmel_attach */ |
| 189 | 187 | ||
| 190 | /*====================================================================== | 188 | /*====================================================================== |
| @@ -230,7 +228,7 @@ static int card_present(void *arg) | |||
| 230 | return 0; | 228 | return 0; |
| 231 | } | 229 | } |
| 232 | 230 | ||
| 233 | static void atmel_config(struct pcmcia_device *link) | 231 | static int atmel_config(struct pcmcia_device *link) |
| 234 | { | 232 | { |
| 235 | tuple_t tuple; | 233 | tuple_t tuple; |
| 236 | cisparse_t parse; | 234 | cisparse_t parse; |
| @@ -377,11 +375,12 @@ static void atmel_config(struct pcmcia_device *link) | |||
| 377 | link->dev_node = &dev->node; | 375 | link->dev_node = &dev->node; |
| 378 | 376 | ||
| 379 | link->state &= ~DEV_CONFIG_PENDING; | 377 | link->state &= ~DEV_CONFIG_PENDING; |
| 380 | return; | 378 | return 0; |
| 381 | 379 | ||
| 382 | cs_failed: | 380 | cs_failed: |
| 383 | cs_error(link, last_fn, last_ret); | 381 | cs_error(link, last_fn, last_ret); |
| 384 | atmel_release(link); | 382 | atmel_release(link); |
| 383 | return -ENODEV; | ||
| 385 | } | 384 | } |
| 386 | 385 | ||
| 387 | /*====================================================================== | 386 | /*====================================================================== |
| @@ -476,7 +475,7 @@ static struct pcmcia_driver atmel_driver = { | |||
| 476 | .drv = { | 475 | .drv = { |
| 477 | .name = "atmel_cs", | 476 | .name = "atmel_cs", |
| 478 | }, | 477 | }, |
| 479 | .probe = atmel_attach, | 478 | .probe = atmel_probe, |
| 480 | .remove = atmel_detach, | 479 | .remove = atmel_detach, |
| 481 | .id_table = atmel_ids, | 480 | .id_table = atmel_ids, |
| 482 | .suspend = atmel_suspend, | 481 | .suspend = atmel_suspend, |
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c index 89b178106edf..88dc383a3da7 100644 --- a/drivers/net/wireless/hostap/hostap_cs.c +++ b/drivers/net/wireless/hostap/hostap_cs.c | |||
| @@ -501,16 +501,20 @@ static struct prism2_helper_functions prism2_pccard_funcs = | |||
| 501 | 501 | ||
| 502 | /* allocate local data and register with CardServices | 502 | /* allocate local data and register with CardServices |
| 503 | * initialize dev_link structure, but do not configure the card yet */ | 503 | * initialize dev_link structure, but do not configure the card yet */ |
| 504 | static int prism2_attach(struct pcmcia_device *p_dev) | 504 | static int hostap_cs_probe(struct pcmcia_device *p_dev) |
| 505 | { | 505 | { |
| 506 | int ret; | ||
| 507 | |||
| 506 | PDEBUG(DEBUG_HW, "%s: setting Vcc=33 (constant)\n", dev_info); | 508 | PDEBUG(DEBUG_HW, "%s: setting Vcc=33 (constant)\n", dev_info); |
| 507 | p_dev->conf.IntType = INT_MEMORY_AND_IO; | 509 | p_dev->conf.IntType = INT_MEMORY_AND_IO; |
| 508 | 510 | ||
| 509 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 511 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 510 | if (prism2_config(p_dev)) | 512 | ret = prism2_config(p_dev); |
| 513 | if (ret) { | ||
| 511 | PDEBUG(DEBUG_EXTRA, "prism2_config() failed\n"); | 514 | PDEBUG(DEBUG_EXTRA, "prism2_config() failed\n"); |
| 515 | } | ||
| 512 | 516 | ||
| 513 | return 0; | 517 | return ret; |
| 514 | } | 518 | } |
| 515 | 519 | ||
| 516 | 520 | ||
| @@ -894,7 +898,7 @@ static struct pcmcia_driver hostap_driver = { | |||
| 894 | .drv = { | 898 | .drv = { |
| 895 | .name = "hostap_cs", | 899 | .name = "hostap_cs", |
| 896 | }, | 900 | }, |
| 897 | .probe = prism2_attach, | 901 | .probe = hostap_cs_probe, |
| 898 | .remove = prism2_detach, | 902 | .remove = prism2_detach, |
| 899 | .owner = THIS_MODULE, | 903 | .owner = THIS_MODULE, |
| 900 | .id_table = hostap_cs_ids, | 904 | .id_table = hostap_cs_ids, |
diff --git a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c index 2a688865f777..2689f3bbc889 100644 --- a/drivers/net/wireless/netwave_cs.c +++ b/drivers/net/wireless/netwave_cs.c | |||
| @@ -191,7 +191,7 @@ module_param(mem_speed, int, 0); | |||
| 191 | 191 | ||
| 192 | /* PCMCIA (Card Services) related functions */ | 192 | /* PCMCIA (Card Services) related functions */ |
| 193 | static void netwave_release(struct pcmcia_device *link); /* Card removal */ | 193 | static void netwave_release(struct pcmcia_device *link); /* Card removal */ |
| 194 | static void netwave_pcmcia_config(struct pcmcia_device *arg); /* Runs after card | 194 | static int netwave_pcmcia_config(struct pcmcia_device *arg); /* Runs after card |
| 195 | insertion */ | 195 | insertion */ |
| 196 | static void netwave_detach(struct pcmcia_device *p_dev); /* Destroy instance */ | 196 | static void netwave_detach(struct pcmcia_device *p_dev); /* Destroy instance */ |
| 197 | 197 | ||
| @@ -376,7 +376,7 @@ static struct iw_statistics *netwave_get_wireless_stats(struct net_device *dev) | |||
| 376 | * configure the card at this point -- we wait until we receive a | 376 | * configure the card at this point -- we wait until we receive a |
| 377 | * card insertion event. | 377 | * card insertion event. |
| 378 | */ | 378 | */ |
| 379 | static int netwave_attach(struct pcmcia_device *link) | 379 | static int netwave_probe(struct pcmcia_device *link) |
| 380 | { | 380 | { |
| 381 | struct net_device *dev; | 381 | struct net_device *dev; |
| 382 | netwave_private *priv; | 382 | netwave_private *priv; |
| @@ -429,9 +429,7 @@ static int netwave_attach(struct pcmcia_device *link) | |||
| 429 | link->irq.Instance = dev; | 429 | link->irq.Instance = dev; |
| 430 | 430 | ||
| 431 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 431 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 432 | netwave_pcmcia_config( link); | 432 | return netwave_pcmcia_config( link); |
| 433 | |||
| 434 | return 0; | ||
| 435 | } /* netwave_attach */ | 433 | } /* netwave_attach */ |
| 436 | 434 | ||
| 437 | /* | 435 | /* |
| @@ -737,7 +735,7 @@ static const struct iw_handler_def netwave_handler_def = | |||
| 737 | #define CS_CHECK(fn, ret) \ | 735 | #define CS_CHECK(fn, ret) \ |
| 738 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 736 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
| 739 | 737 | ||
| 740 | static void netwave_pcmcia_config(struct pcmcia_device *link) { | 738 | static int netwave_pcmcia_config(struct pcmcia_device *link) { |
| 741 | struct net_device *dev = link->priv; | 739 | struct net_device *dev = link->priv; |
| 742 | netwave_private *priv = netdev_priv(dev); | 740 | netwave_private *priv = netdev_priv(dev); |
| 743 | tuple_t tuple; | 741 | tuple_t tuple; |
| @@ -845,12 +843,13 @@ static void netwave_pcmcia_config(struct pcmcia_device *link) { | |||
| 845 | printk(KERN_DEBUG "Netwave_reset: revision %04x %04x\n", | 843 | printk(KERN_DEBUG "Netwave_reset: revision %04x %04x\n", |
| 846 | get_uint16(ramBase + NETWAVE_EREG_ARW), | 844 | get_uint16(ramBase + NETWAVE_EREG_ARW), |
| 847 | get_uint16(ramBase + NETWAVE_EREG_ARW+2)); | 845 | get_uint16(ramBase + NETWAVE_EREG_ARW+2)); |
| 848 | return; | 846 | return 0; |
| 849 | 847 | ||
| 850 | cs_failed: | 848 | cs_failed: |
| 851 | cs_error(link, last_fn, last_ret); | 849 | cs_error(link, last_fn, last_ret); |
| 852 | failed: | 850 | failed: |
| 853 | netwave_release(link); | 851 | netwave_release(link); |
| 852 | return -ENODEV; | ||
| 854 | } /* netwave_pcmcia_config */ | 853 | } /* netwave_pcmcia_config */ |
| 855 | 854 | ||
| 856 | /* | 855 | /* |
| @@ -1387,7 +1386,7 @@ static struct pcmcia_driver netwave_driver = { | |||
| 1387 | .drv = { | 1386 | .drv = { |
| 1388 | .name = "netwave_cs", | 1387 | .name = "netwave_cs", |
| 1389 | }, | 1388 | }, |
| 1390 | .probe = netwave_attach, | 1389 | .probe = netwave_probe, |
| 1391 | .remove = netwave_detach, | 1390 | .remove = netwave_detach, |
| 1392 | .id_table = netwave_ids, | 1391 | .id_table = netwave_ids, |
| 1393 | .suspend = netwave_suspend, | 1392 | .suspend = netwave_suspend, |
diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c index 405b7baa8bc3..0e92bee16c9b 100644 --- a/drivers/net/wireless/orinoco_cs.c +++ b/drivers/net/wireless/orinoco_cs.c | |||
| @@ -63,7 +63,7 @@ struct orinoco_pccard { | |||
| 63 | /* Function prototypes */ | 63 | /* Function prototypes */ |
| 64 | /********************************************************************/ | 64 | /********************************************************************/ |
| 65 | 65 | ||
| 66 | static void orinoco_cs_config(struct pcmcia_device *link); | 66 | static int orinoco_cs_config(struct pcmcia_device *link); |
| 67 | static void orinoco_cs_release(struct pcmcia_device *link); | 67 | static void orinoco_cs_release(struct pcmcia_device *link); |
| 68 | static void orinoco_cs_detach(struct pcmcia_device *p_dev); | 68 | static void orinoco_cs_detach(struct pcmcia_device *p_dev); |
| 69 | 69 | ||
| @@ -104,7 +104,7 @@ orinoco_cs_hard_reset(struct orinoco_private *priv) | |||
| 104 | * configure the card at this point -- we wait until we receive a card | 104 | * configure the card at this point -- we wait until we receive a card |
| 105 | * insertion event. */ | 105 | * insertion event. */ |
| 106 | static int | 106 | static int |
| 107 | orinoco_cs_attach(struct pcmcia_device *link) | 107 | orinoco_cs_probe(struct pcmcia_device *link) |
| 108 | { | 108 | { |
| 109 | struct net_device *dev; | 109 | struct net_device *dev; |
| 110 | struct orinoco_private *priv; | 110 | struct orinoco_private *priv; |
| @@ -135,9 +135,7 @@ orinoco_cs_attach(struct pcmcia_device *link) | |||
| 135 | link->conf.IntType = INT_MEMORY_AND_IO; | 135 | link->conf.IntType = INT_MEMORY_AND_IO; |
| 136 | 136 | ||
| 137 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 137 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 138 | orinoco_cs_config(link); | 138 | return orinoco_cs_config(link); |
| 139 | |||
| 140 | return 0; | ||
| 141 | } /* orinoco_cs_attach */ | 139 | } /* orinoco_cs_attach */ |
| 142 | 140 | ||
| 143 | /* | 141 | /* |
| @@ -172,7 +170,7 @@ static void orinoco_cs_detach(struct pcmcia_device *link) | |||
| 172 | last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; \ | 170 | last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; \ |
| 173 | } while (0) | 171 | } while (0) |
| 174 | 172 | ||
| 175 | static void | 173 | static int |
| 176 | orinoco_cs_config(struct pcmcia_device *link) | 174 | orinoco_cs_config(struct pcmcia_device *link) |
| 177 | { | 175 | { |
| 178 | struct net_device *dev = link->priv; | 176 | struct net_device *dev = link->priv; |
| @@ -377,13 +375,14 @@ orinoco_cs_config(struct pcmcia_device *link) | |||
| 377 | link->io.BasePort2 + link->io.NumPorts2 - 1); | 375 | link->io.BasePort2 + link->io.NumPorts2 - 1); |
| 378 | printk("\n"); | 376 | printk("\n"); |
| 379 | 377 | ||
| 380 | return; | 378 | return 0; |
| 381 | 379 | ||
| 382 | cs_failed: | 380 | cs_failed: |
| 383 | cs_error(link, last_fn, last_ret); | 381 | cs_error(link, last_fn, last_ret); |
| 384 | 382 | ||
| 385 | failed: | 383 | failed: |
| 386 | orinoco_cs_release(link); | 384 | orinoco_cs_release(link); |
| 385 | return -ENODEV; | ||
| 387 | } /* orinoco_cs_config */ | 386 | } /* orinoco_cs_config */ |
| 388 | 387 | ||
| 389 | /* | 388 | /* |
| @@ -576,7 +575,7 @@ static struct pcmcia_driver orinoco_driver = { | |||
| 576 | .drv = { | 575 | .drv = { |
| 577 | .name = DRIVER_NAME, | 576 | .name = DRIVER_NAME, |
| 578 | }, | 577 | }, |
| 579 | .probe = orinoco_cs_attach, | 578 | .probe = orinoco_cs_probe, |
| 580 | .remove = orinoco_cs_detach, | 579 | .remove = orinoco_cs_detach, |
| 581 | .id_table = orinoco_cs_ids, | 580 | .id_table = orinoco_cs_ids, |
| 582 | .suspend = orinoco_cs_suspend, | 581 | .suspend = orinoco_cs_suspend, |
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 415ae8be1e22..8cfe9332a3c1 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c | |||
| @@ -90,7 +90,7 @@ module_param(pc_debug, int, 0); | |||
| 90 | #define DEBUG(n, args...) | 90 | #define DEBUG(n, args...) |
| 91 | #endif | 91 | #endif |
| 92 | /** Prototypes based on PCMCIA skeleton driver *******************************/ | 92 | /** Prototypes based on PCMCIA skeleton driver *******************************/ |
| 93 | static void ray_config(struct pcmcia_device *link); | 93 | static int ray_config(struct pcmcia_device *link); |
| 94 | static void ray_release(struct pcmcia_device *link); | 94 | static void ray_release(struct pcmcia_device *link); |
| 95 | static void ray_detach(struct pcmcia_device *p_dev); | 95 | static void ray_detach(struct pcmcia_device *p_dev); |
| 96 | 96 | ||
| @@ -303,7 +303,7 @@ static char rcsid[] = "Raylink/WebGear wireless LAN - Corey <Thomas corey@world. | |||
| 303 | configure the card at this point -- we wait until we receive a | 303 | configure the card at this point -- we wait until we receive a |
| 304 | card insertion event. | 304 | card insertion event. |
| 305 | =============================================================================*/ | 305 | =============================================================================*/ |
| 306 | static int ray_attach(struct pcmcia_device *p_dev) | 306 | static int ray_probe(struct pcmcia_device *p_dev) |
| 307 | { | 307 | { |
| 308 | ray_dev_t *local; | 308 | ray_dev_t *local; |
| 309 | struct net_device *dev; | 309 | struct net_device *dev; |
| @@ -368,9 +368,7 @@ static int ray_attach(struct pcmcia_device *p_dev) | |||
| 368 | 368 | ||
| 369 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 369 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 370 | this_device = p_dev; | 370 | this_device = p_dev; |
| 371 | ray_config(p_dev); | 371 | return ray_config(p_dev); |
| 372 | |||
| 373 | return 0; | ||
| 374 | 372 | ||
| 375 | fail_alloc_dev: | 373 | fail_alloc_dev: |
| 376 | return -ENOMEM; | 374 | return -ENOMEM; |
| @@ -412,7 +410,7 @@ static void ray_detach(struct pcmcia_device *link) | |||
| 412 | #define CS_CHECK(fn, ret) \ | 410 | #define CS_CHECK(fn, ret) \ |
| 413 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 411 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
| 414 | #define MAX_TUPLE_SIZE 128 | 412 | #define MAX_TUPLE_SIZE 128 |
| 415 | static void ray_config(struct pcmcia_device *link) | 413 | static int ray_config(struct pcmcia_device *link) |
| 416 | { | 414 | { |
| 417 | tuple_t tuple; | 415 | tuple_t tuple; |
| 418 | cisparse_t parse; | 416 | cisparse_t parse; |
| @@ -499,7 +497,7 @@ static void ray_config(struct pcmcia_device *link) | |||
| 499 | DEBUG(3,"ray_config amem=%p\n",local->amem); | 497 | DEBUG(3,"ray_config amem=%p\n",local->amem); |
| 500 | if (ray_init(dev) < 0) { | 498 | if (ray_init(dev) < 0) { |
| 501 | ray_release(link); | 499 | ray_release(link); |
| 502 | return; | 500 | return -ENODEV; |
| 503 | } | 501 | } |
| 504 | 502 | ||
| 505 | SET_NETDEV_DEV(dev, &handle_to_dev(link)); | 503 | SET_NETDEV_DEV(dev, &handle_to_dev(link)); |
| @@ -507,7 +505,7 @@ static void ray_config(struct pcmcia_device *link) | |||
| 507 | if (i != 0) { | 505 | if (i != 0) { |
| 508 | printk("ray_config register_netdev() failed\n"); | 506 | printk("ray_config register_netdev() failed\n"); |
| 509 | ray_release(link); | 507 | ray_release(link); |
| 510 | return; | 508 | return i; |
| 511 | } | 509 | } |
| 512 | 510 | ||
| 513 | strcpy(local->node.dev_name, dev->name); | 511 | strcpy(local->node.dev_name, dev->name); |
| @@ -519,12 +517,13 @@ static void ray_config(struct pcmcia_device *link) | |||
| 519 | for (i = 0; i < 6; i++) | 517 | for (i = 0; i < 6; i++) |
| 520 | printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n")); | 518 | printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n")); |
| 521 | 519 | ||
| 522 | return; | 520 | return 0; |
| 523 | 521 | ||
| 524 | cs_failed: | 522 | cs_failed: |
| 525 | cs_error(link, last_fn, last_ret); | 523 | cs_error(link, last_fn, last_ret); |
| 526 | 524 | ||
| 527 | ray_release(link); | 525 | ray_release(link); |
| 526 | return -ENODEV; | ||
| 528 | } /* ray_config */ | 527 | } /* ray_config */ |
| 529 | 528 | ||
| 530 | static inline struct ccs __iomem *ccs_base(ray_dev_t *dev) | 529 | static inline struct ccs __iomem *ccs_base(ray_dev_t *dev) |
| @@ -2846,7 +2845,7 @@ static struct pcmcia_driver ray_driver = { | |||
| 2846 | .drv = { | 2845 | .drv = { |
| 2847 | .name = "ray_cs", | 2846 | .name = "ray_cs", |
| 2848 | }, | 2847 | }, |
| 2849 | .probe = ray_attach, | 2848 | .probe = ray_probe, |
| 2850 | .remove = ray_detach, | 2849 | .remove = ray_detach, |
| 2851 | .id_table = ray_ids, | 2850 | .id_table = ray_ids, |
| 2852 | .suspend = ray_suspend, | 2851 | .suspend = ray_suspend, |
diff --git a/drivers/net/wireless/spectrum_cs.c b/drivers/net/wireless/spectrum_cs.c index a75ea7e593ac..118b2c6e5a29 100644 --- a/drivers/net/wireless/spectrum_cs.c +++ b/drivers/net/wireless/spectrum_cs.c | |||
| @@ -71,7 +71,7 @@ struct orinoco_pccard { | |||
| 71 | /* Function prototypes */ | 71 | /* Function prototypes */ |
| 72 | /********************************************************************/ | 72 | /********************************************************************/ |
| 73 | 73 | ||
| 74 | static void spectrum_cs_config(struct pcmcia_device *link); | 74 | static int spectrum_cs_config(struct pcmcia_device *link); |
| 75 | static void spectrum_cs_release(struct pcmcia_device *link); | 75 | static void spectrum_cs_release(struct pcmcia_device *link); |
| 76 | 76 | ||
| 77 | /********************************************************************/ | 77 | /********************************************************************/ |
| @@ -583,7 +583,7 @@ spectrum_cs_hard_reset(struct orinoco_private *priv) | |||
| 583 | * configure the card at this point -- we wait until we receive a card | 583 | * configure the card at this point -- we wait until we receive a card |
| 584 | * insertion event. */ | 584 | * insertion event. */ |
| 585 | static int | 585 | static int |
| 586 | spectrum_cs_attach(struct pcmcia_device *link) | 586 | spectrum_cs_probe(struct pcmcia_device *link) |
| 587 | { | 587 | { |
| 588 | struct net_device *dev; | 588 | struct net_device *dev; |
| 589 | struct orinoco_private *priv; | 589 | struct orinoco_private *priv; |
| @@ -614,9 +614,7 @@ spectrum_cs_attach(struct pcmcia_device *link) | |||
| 614 | link->conf.IntType = INT_MEMORY_AND_IO; | 614 | link->conf.IntType = INT_MEMORY_AND_IO; |
| 615 | 615 | ||
| 616 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 616 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 617 | spectrum_cs_config(link); | 617 | return spectrum_cs_config(link); |
| 618 | |||
| 619 | return 0; | ||
| 620 | } /* spectrum_cs_attach */ | 618 | } /* spectrum_cs_attach */ |
| 621 | 619 | ||
| 622 | /* | 620 | /* |
| @@ -647,7 +645,7 @@ static void spectrum_cs_detach(struct pcmcia_device *link) | |||
| 647 | * device available to the system. | 645 | * device available to the system. |
| 648 | */ | 646 | */ |
| 649 | 647 | ||
| 650 | static void | 648 | static int |
| 651 | spectrum_cs_config(struct pcmcia_device *link) | 649 | spectrum_cs_config(struct pcmcia_device *link) |
| 652 | { | 650 | { |
| 653 | struct net_device *dev = link->priv; | 651 | struct net_device *dev = link->priv; |
| @@ -857,13 +855,14 @@ spectrum_cs_config(struct pcmcia_device *link) | |||
| 857 | link->io.BasePort2 + link->io.NumPorts2 - 1); | 855 | link->io.BasePort2 + link->io.NumPorts2 - 1); |
| 858 | printk("\n"); | 856 | printk("\n"); |
| 859 | 857 | ||
| 860 | return; | 858 | return 0; |
| 861 | 859 | ||
| 862 | cs_failed: | 860 | cs_failed: |
| 863 | cs_error(link, last_fn, last_ret); | 861 | cs_error(link, last_fn, last_ret); |
| 864 | 862 | ||
| 865 | failed: | 863 | failed: |
| 866 | spectrum_cs_release(link); | 864 | spectrum_cs_release(link); |
| 865 | return -ENODEV; | ||
| 867 | } /* spectrum_cs_config */ | 866 | } /* spectrum_cs_config */ |
| 868 | 867 | ||
| 869 | /* | 868 | /* |
| @@ -954,7 +953,7 @@ static struct pcmcia_driver orinoco_driver = { | |||
| 954 | .drv = { | 953 | .drv = { |
| 955 | .name = DRIVER_NAME, | 954 | .name = DRIVER_NAME, |
| 956 | }, | 955 | }, |
| 957 | .probe = spectrum_cs_attach, | 956 | .probe = spectrum_cs_probe, |
| 958 | .remove = spectrum_cs_detach, | 957 | .remove = spectrum_cs_detach, |
| 959 | .suspend = spectrum_cs_suspend, | 958 | .suspend = spectrum_cs_suspend, |
| 960 | .resume = spectrum_cs_resume, | 959 | .resume = spectrum_cs_resume, |
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c index 352d4a50b799..7373caf6e8e8 100644 --- a/drivers/net/wireless/wavelan_cs.c +++ b/drivers/net/wireless/wavelan_cs.c | |||
| @@ -4580,10 +4580,11 @@ wavelan_close(struct net_device * dev) | |||
| 4580 | * card insertion event. | 4580 | * card insertion event. |
| 4581 | */ | 4581 | */ |
| 4582 | static int | 4582 | static int |
| 4583 | wavelan_attach(struct pcmcia_device *p_dev) | 4583 | wavelan_probe(struct pcmcia_device *p_dev) |
| 4584 | { | 4584 | { |
| 4585 | struct net_device * dev; /* Interface generic data */ | 4585 | struct net_device * dev; /* Interface generic data */ |
| 4586 | net_local * lp; /* Interface specific data */ | 4586 | net_local * lp; /* Interface specific data */ |
| 4587 | int ret; | ||
| 4587 | 4588 | ||
| 4588 | #ifdef DEBUG_CALLBACK_TRACE | 4589 | #ifdef DEBUG_CALLBACK_TRACE |
| 4589 | printk(KERN_DEBUG "-> wavelan_attach()\n"); | 4590 | printk(KERN_DEBUG "-> wavelan_attach()\n"); |
| @@ -4651,11 +4652,18 @@ wavelan_attach(struct pcmcia_device *p_dev) | |||
| 4651 | dev->mtu = WAVELAN_MTU; | 4652 | dev->mtu = WAVELAN_MTU; |
| 4652 | 4653 | ||
| 4653 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 4654 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 4654 | if(wv_pcmcia_config(p_dev) && | 4655 | ret = wv_pcmcia_config(p_dev); |
| 4655 | wv_hw_config(dev)) | 4656 | if (ret) |
| 4656 | wv_init_info(dev); | 4657 | return ret; |
| 4657 | else | 4658 | |
| 4659 | ret = wv_hw_config(dev); | ||
| 4660 | if (ret) { | ||
| 4658 | dev->irq = 0; | 4661 | dev->irq = 0; |
| 4662 | pcmcia_disable_device(p_dev); | ||
| 4663 | return ret; | ||
| 4664 | } | ||
| 4665 | |||
| 4666 | wv_init_info(dev); | ||
| 4659 | 4667 | ||
| 4660 | #ifdef DEBUG_CALLBACK_TRACE | 4668 | #ifdef DEBUG_CALLBACK_TRACE |
| 4661 | printk(KERN_DEBUG "<- wavelan_attach()\n"); | 4669 | printk(KERN_DEBUG "<- wavelan_attach()\n"); |
| @@ -4760,7 +4768,7 @@ static struct pcmcia_driver wavelan_driver = { | |||
| 4760 | .drv = { | 4768 | .drv = { |
| 4761 | .name = "wavelan_cs", | 4769 | .name = "wavelan_cs", |
| 4762 | }, | 4770 | }, |
| 4763 | .probe = wavelan_attach, | 4771 | .probe = wavelan_probe, |
| 4764 | .remove = wavelan_detach, | 4772 | .remove = wavelan_detach, |
| 4765 | .id_table = wavelan_ids, | 4773 | .id_table = wavelan_ids, |
| 4766 | .suspend = wavelan_suspend, | 4774 | .suspend = wavelan_suspend, |
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c index 752d22260080..6b3a605897bd 100644 --- a/drivers/net/wireless/wl3501_cs.c +++ b/drivers/net/wireless/wl3501_cs.c | |||
| @@ -103,7 +103,7 @@ module_param(pc_debug, int, 0); | |||
| 103 | * release a socket, in response to card insertion and ejection events. They | 103 | * release a socket, in response to card insertion and ejection events. They |
| 104 | * are invoked from the wl24 event handler. | 104 | * are invoked from the wl24 event handler. |
| 105 | */ | 105 | */ |
| 106 | static void wl3501_config(struct pcmcia_device *link); | 106 | static int wl3501_config(struct pcmcia_device *link); |
| 107 | static void wl3501_release(struct pcmcia_device *link); | 107 | static void wl3501_release(struct pcmcia_device *link); |
| 108 | 108 | ||
| 109 | /* | 109 | /* |
| @@ -1920,7 +1920,7 @@ static const struct iw_handler_def wl3501_handler_def = { | |||
| 1920 | * The dev_link structure is initialized, but we don't actually configure the | 1920 | * The dev_link structure is initialized, but we don't actually configure the |
| 1921 | * card at this point -- we wait until we receive a card insertion event. | 1921 | * card at this point -- we wait until we receive a card insertion event. |
| 1922 | */ | 1922 | */ |
| 1923 | static int wl3501_attach(struct pcmcia_device *p_dev) | 1923 | static int wl3501_probe(struct pcmcia_device *p_dev) |
| 1924 | { | 1924 | { |
| 1925 | struct net_device *dev; | 1925 | struct net_device *dev; |
| 1926 | struct wl3501_card *this; | 1926 | struct wl3501_card *this; |
| @@ -1960,9 +1960,7 @@ static int wl3501_attach(struct pcmcia_device *p_dev) | |||
| 1960 | p_dev->priv = p_dev->irq.Instance = dev; | 1960 | p_dev->priv = p_dev->irq.Instance = dev; |
| 1961 | 1961 | ||
| 1962 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 1962 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 1963 | wl3501_config(p_dev); | 1963 | return wl3501_config(p_dev); |
| 1964 | |||
| 1965 | return 0; | ||
| 1966 | out_link: | 1964 | out_link: |
| 1967 | return -ENOMEM; | 1965 | return -ENOMEM; |
| 1968 | } | 1966 | } |
| @@ -1978,7 +1976,7 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | |||
| 1978 | * received, to configure the PCMCIA socket, and to make the ethernet device | 1976 | * received, to configure the PCMCIA socket, and to make the ethernet device |
| 1979 | * available to the system. | 1977 | * available to the system. |
| 1980 | */ | 1978 | */ |
| 1981 | static void wl3501_config(struct pcmcia_device *link) | 1979 | static int wl3501_config(struct pcmcia_device *link) |
| 1982 | { | 1980 | { |
| 1983 | tuple_t tuple; | 1981 | tuple_t tuple; |
| 1984 | cisparse_t parse; | 1982 | cisparse_t parse; |
| @@ -2082,13 +2080,13 @@ static void wl3501_config(struct pcmcia_device *link) | |||
| 2082 | spin_lock_init(&this->lock); | 2080 | spin_lock_init(&this->lock); |
| 2083 | init_waitqueue_head(&this->wait); | 2081 | init_waitqueue_head(&this->wait); |
| 2084 | netif_start_queue(dev); | 2082 | netif_start_queue(dev); |
| 2085 | goto out; | 2083 | return 0; |
| 2084 | |||
| 2086 | cs_failed: | 2085 | cs_failed: |
| 2087 | cs_error(link, last_fn, last_ret); | 2086 | cs_error(link, last_fn, last_ret); |
| 2088 | failed: | 2087 | failed: |
| 2089 | wl3501_release(link); | 2088 | wl3501_release(link); |
| 2090 | out: | 2089 | return -ENODEV; |
| 2091 | return; | ||
| 2092 | } | 2090 | } |
| 2093 | 2091 | ||
| 2094 | /** | 2092 | /** |
| @@ -2146,7 +2144,7 @@ static struct pcmcia_driver wl3501_driver = { | |||
| 2146 | .drv = { | 2144 | .drv = { |
| 2147 | .name = "wl3501_cs", | 2145 | .name = "wl3501_cs", |
| 2148 | }, | 2146 | }, |
| 2149 | .probe = wl3501_attach, | 2147 | .probe = wl3501_probe, |
| 2150 | .remove = wl3501_detach, | 2148 | .remove = wl3501_detach, |
| 2151 | .id_table = wl3501_ids, | 2149 | .id_table = wl3501_ids, |
| 2152 | .suspend = wl3501_suspend, | 2150 | .suspend = wl3501_suspend, |
diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c index 6dcaf44c120a..e4be826c48ba 100644 --- a/drivers/parport/parport_cs.c +++ b/drivers/parport/parport_cs.c | |||
| @@ -88,7 +88,7 @@ typedef struct parport_info_t { | |||
| 88 | } parport_info_t; | 88 | } parport_info_t; |
| 89 | 89 | ||
| 90 | static void parport_detach(struct pcmcia_device *p_dev); | 90 | static void parport_detach(struct pcmcia_device *p_dev); |
| 91 | static void parport_config(struct pcmcia_device *link); | 91 | static int parport_config(struct pcmcia_device *link); |
| 92 | static void parport_cs_release(struct pcmcia_device *); | 92 | static void parport_cs_release(struct pcmcia_device *); |
| 93 | 93 | ||
| 94 | /*====================================================================== | 94 | /*====================================================================== |
| @@ -99,7 +99,7 @@ static void parport_cs_release(struct pcmcia_device *); | |||
| 99 | 99 | ||
| 100 | ======================================================================*/ | 100 | ======================================================================*/ |
| 101 | 101 | ||
| 102 | static int parport_attach(struct pcmcia_device *link) | 102 | static int parport_probe(struct pcmcia_device *link) |
| 103 | { | 103 | { |
| 104 | parport_info_t *info; | 104 | parport_info_t *info; |
| 105 | 105 | ||
| @@ -120,9 +120,7 @@ static int parport_attach(struct pcmcia_device *link) | |||
| 120 | link->conf.IntType = INT_MEMORY_AND_IO; | 120 | link->conf.IntType = INT_MEMORY_AND_IO; |
| 121 | 121 | ||
| 122 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 122 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 123 | parport_config(link); | 123 | return parport_config(link); |
| 124 | |||
| 125 | return 0; | ||
| 126 | } /* parport_attach */ | 124 | } /* parport_attach */ |
| 127 | 125 | ||
| 128 | /*====================================================================== | 126 | /*====================================================================== |
| @@ -155,7 +153,7 @@ static void parport_detach(struct pcmcia_device *link) | |||
| 155 | #define CS_CHECK(fn, ret) \ | 153 | #define CS_CHECK(fn, ret) \ |
| 156 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 154 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
| 157 | 155 | ||
| 158 | void parport_config(struct pcmcia_device *link) | 156 | static int parport_config(struct pcmcia_device *link) |
| 159 | { | 157 | { |
| 160 | parport_info_t *info = link->priv; | 158 | parport_info_t *info = link->priv; |
| 161 | tuple_t tuple; | 159 | tuple_t tuple; |
| @@ -236,14 +234,14 @@ void parport_config(struct pcmcia_device *link) | |||
| 236 | link->dev_node = &info->node; | 234 | link->dev_node = &info->node; |
| 237 | 235 | ||
| 238 | link->state &= ~DEV_CONFIG_PENDING; | 236 | link->state &= ~DEV_CONFIG_PENDING; |
| 239 | return; | 237 | return 0; |
| 240 | 238 | ||
| 241 | cs_failed: | 239 | cs_failed: |
| 242 | cs_error(link, last_fn, last_ret); | 240 | cs_error(link, last_fn, last_ret); |
| 243 | failed: | 241 | failed: |
| 244 | parport_cs_release(link); | 242 | parport_cs_release(link); |
| 245 | link->state &= ~DEV_CONFIG_PENDING; | 243 | link->state &= ~DEV_CONFIG_PENDING; |
| 246 | 244 | return -ENODEV; | |
| 247 | } /* parport_config */ | 245 | } /* parport_config */ |
| 248 | 246 | ||
| 249 | /*====================================================================== | 247 | /*====================================================================== |
| @@ -282,7 +280,7 @@ static struct pcmcia_driver parport_cs_driver = { | |||
| 282 | .drv = { | 280 | .drv = { |
| 283 | .name = "parport_cs", | 281 | .name = "parport_cs", |
| 284 | }, | 282 | }, |
| 285 | .probe = parport_attach, | 283 | .probe = parport_probe, |
| 286 | .remove = parport_detach, | 284 | .remove = parport_detach, |
| 287 | .id_table = parport_ids, | 285 | .id_table = parport_ids, |
| 288 | }; | 286 | }; |
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c index 21c6b1014535..7caa700cf189 100644 --- a/drivers/scsi/pcmcia/aha152x_stub.c +++ b/drivers/scsi/pcmcia/aha152x_stub.c | |||
| @@ -96,11 +96,11 @@ typedef struct scsi_info_t { | |||
| 96 | 96 | ||
| 97 | static void aha152x_release_cs(struct pcmcia_device *link); | 97 | static void aha152x_release_cs(struct pcmcia_device *link); |
| 98 | static void aha152x_detach(struct pcmcia_device *p_dev); | 98 | static void aha152x_detach(struct pcmcia_device *p_dev); |
| 99 | static void aha152x_config_cs(struct pcmcia_device *link); | 99 | static int aha152x_config_cs(struct pcmcia_device *link); |
| 100 | 100 | ||
| 101 | static struct pcmcia_device *dev_list; | 101 | static struct pcmcia_device *dev_list; |
| 102 | 102 | ||
| 103 | static int aha152x_attach(struct pcmcia_device *link) | 103 | static int aha152x_probe(struct pcmcia_device *link) |
| 104 | { | 104 | { |
| 105 | scsi_info_t *info; | 105 | scsi_info_t *info; |
| 106 | 106 | ||
| @@ -123,9 +123,7 @@ static int aha152x_attach(struct pcmcia_device *link) | |||
| 123 | link->conf.Present = PRESENT_OPTION; | 123 | link->conf.Present = PRESENT_OPTION; |
| 124 | 124 | ||
| 125 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 125 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 126 | aha152x_config_cs(link); | 126 | return aha152x_config_cs(link); |
| 127 | |||
| 128 | return 0; | ||
| 129 | } /* aha152x_attach */ | 127 | } /* aha152x_attach */ |
| 130 | 128 | ||
| 131 | /*====================================================================*/ | 129 | /*====================================================================*/ |
| @@ -146,7 +144,7 @@ static void aha152x_detach(struct pcmcia_device *link) | |||
| 146 | #define CS_CHECK(fn, ret) \ | 144 | #define CS_CHECK(fn, ret) \ |
| 147 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 145 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
| 148 | 146 | ||
| 149 | static void aha152x_config_cs(struct pcmcia_device *link) | 147 | static int aha152x_config_cs(struct pcmcia_device *link) |
| 150 | { | 148 | { |
| 151 | scsi_info_t *info = link->priv; | 149 | scsi_info_t *info = link->priv; |
| 152 | struct aha152x_setup s; | 150 | struct aha152x_setup s; |
| @@ -219,12 +217,12 @@ static void aha152x_config_cs(struct pcmcia_device *link) | |||
| 219 | info->host = host; | 217 | info->host = host; |
| 220 | 218 | ||
| 221 | link->state &= ~DEV_CONFIG_PENDING; | 219 | link->state &= ~DEV_CONFIG_PENDING; |
| 222 | return; | 220 | return 0; |
| 223 | 221 | ||
| 224 | cs_failed: | 222 | cs_failed: |
| 225 | cs_error(link, last_fn, last_ret); | 223 | cs_error(link, last_fn, last_ret); |
| 226 | aha152x_release_cs(link); | 224 | aha152x_release_cs(link); |
| 227 | return; | 225 | return -ENODEV; |
| 228 | } | 226 | } |
| 229 | 227 | ||
| 230 | static void aha152x_release_cs(struct pcmcia_device *link) | 228 | static void aha152x_release_cs(struct pcmcia_device *link) |
| @@ -259,7 +257,7 @@ static struct pcmcia_driver aha152x_cs_driver = { | |||
| 259 | .drv = { | 257 | .drv = { |
| 260 | .name = "aha152x_cs", | 258 | .name = "aha152x_cs", |
| 261 | }, | 259 | }, |
| 262 | .probe = aha152x_attach, | 260 | .probe = aha152x_probe, |
| 263 | .remove = aha152x_detach, | 261 | .remove = aha152x_detach, |
| 264 | .id_table = aha152x_ids, | 262 | .id_table = aha152x_ids, |
| 265 | .resume = aha152x_resume, | 263 | .resume = aha152x_resume, |
| @@ -278,4 +276,3 @@ static void __exit exit_aha152x_cs(void) | |||
| 278 | 276 | ||
| 279 | module_init(init_aha152x_cs); | 277 | module_init(init_aha152x_cs); |
| 280 | module_exit(exit_aha152x_cs); | 278 | module_exit(exit_aha152x_cs); |
| 281 | |||
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c index 4e6927112c05..80afd3e879cc 100644 --- a/drivers/scsi/pcmcia/fdomain_stub.c +++ b/drivers/scsi/pcmcia/fdomain_stub.c | |||
| @@ -81,33 +81,32 @@ typedef struct scsi_info_t { | |||
| 81 | 81 | ||
| 82 | static void fdomain_release(struct pcmcia_device *link); | 82 | static void fdomain_release(struct pcmcia_device *link); |
| 83 | static void fdomain_detach(struct pcmcia_device *p_dev); | 83 | static void fdomain_detach(struct pcmcia_device *p_dev); |
| 84 | static void fdomain_config(struct pcmcia_device *link); | 84 | static int fdomain_config(struct pcmcia_device *link); |
| 85 | 85 | ||
| 86 | static int fdomain_attach(struct pcmcia_device *link) | 86 | static int fdomain_probe(struct pcmcia_device *link) |
| 87 | { | 87 | { |
| 88 | scsi_info_t *info; | 88 | scsi_info_t *info; |
| 89 | 89 | ||
| 90 | DEBUG(0, "fdomain_attach()\n"); | 90 | DEBUG(0, "fdomain_attach()\n"); |
| 91 | 91 | ||
| 92 | /* Create new SCSI device */ | 92 | /* Create new SCSI device */ |
| 93 | info = kmalloc(sizeof(*info), GFP_KERNEL); | 93 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
| 94 | if (!info) return -ENOMEM; | 94 | if (!info) |
| 95 | memset(info, 0, sizeof(*info)); | 95 | return -ENOMEM; |
| 96 | info->p_dev = link; | 96 | |
| 97 | link->priv = info; | 97 | info->p_dev = link; |
| 98 | link->io.NumPorts1 = 0x10; | 98 | link->priv = info; |
| 99 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 99 | link->io.NumPorts1 = 0x10; |
| 100 | link->io.IOAddrLines = 10; | 100 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; |
| 101 | link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; | 101 | link->io.IOAddrLines = 10; |
| 102 | link->irq.IRQInfo1 = IRQ_LEVEL_ID; | 102 | link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; |
| 103 | link->conf.Attributes = CONF_ENABLE_IRQ; | 103 | link->irq.IRQInfo1 = IRQ_LEVEL_ID; |
| 104 | link->conf.IntType = INT_MEMORY_AND_IO; | 104 | link->conf.Attributes = CONF_ENABLE_IRQ; |
| 105 | link->conf.Present = PRESENT_OPTION; | 105 | link->conf.IntType = INT_MEMORY_AND_IO; |
| 106 | 106 | link->conf.Present = PRESENT_OPTION; | |
| 107 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 107 | |
| 108 | fdomain_config(link); | 108 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 109 | 109 | return fdomain_config(link); | |
| 110 | return 0; | ||
| 111 | } /* fdomain_attach */ | 110 | } /* fdomain_attach */ |
| 112 | 111 | ||
| 113 | /*====================================================================*/ | 112 | /*====================================================================*/ |
| @@ -127,7 +126,7 @@ static void fdomain_detach(struct pcmcia_device *link) | |||
| 127 | #define CS_CHECK(fn, ret) \ | 126 | #define CS_CHECK(fn, ret) \ |
| 128 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 127 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
| 129 | 128 | ||
| 130 | static void fdomain_config(struct pcmcia_device *link) | 129 | static int fdomain_config(struct pcmcia_device *link) |
| 131 | { | 130 | { |
| 132 | scsi_info_t *info = link->priv; | 131 | scsi_info_t *info = link->priv; |
| 133 | tuple_t tuple; | 132 | tuple_t tuple; |
| @@ -150,7 +149,7 @@ static void fdomain_config(struct pcmcia_device *link) | |||
| 150 | 149 | ||
| 151 | /* Configure card */ | 150 | /* Configure card */ |
| 152 | link->state |= DEV_CONFIG; | 151 | link->state |= DEV_CONFIG; |
| 153 | 152 | ||
| 154 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 153 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
| 155 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | 154 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |
| 156 | while (1) { | 155 | while (1) { |
| @@ -167,35 +166,35 @@ static void fdomain_config(struct pcmcia_device *link) | |||
| 167 | 166 | ||
| 168 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); | 167 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); |
| 169 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); | 168 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); |
| 170 | 169 | ||
| 171 | /* A bad hack... */ | 170 | /* A bad hack... */ |
| 172 | release_region(link->io.BasePort1, link->io.NumPorts1); | 171 | release_region(link->io.BasePort1, link->io.NumPorts1); |
| 173 | 172 | ||
| 174 | /* Set configuration options for the fdomain driver */ | 173 | /* Set configuration options for the fdomain driver */ |
| 175 | sprintf(str, "%d,%d", link->io.BasePort1, link->irq.AssignedIRQ); | 174 | sprintf(str, "%d,%d", link->io.BasePort1, link->irq.AssignedIRQ); |
| 176 | fdomain_setup(str); | 175 | fdomain_setup(str); |
| 177 | 176 | ||
| 178 | host = __fdomain_16x0_detect(&fdomain_driver_template); | 177 | host = __fdomain_16x0_detect(&fdomain_driver_template); |
| 179 | if (!host) { | 178 | if (!host) { |
| 180 | printk(KERN_INFO "fdomain_cs: no SCSI devices found\n"); | 179 | printk(KERN_INFO "fdomain_cs: no SCSI devices found\n"); |
| 181 | goto cs_failed; | 180 | goto cs_failed; |
| 182 | } | 181 | } |
| 183 | 182 | ||
| 184 | scsi_add_host(host, NULL); /* XXX handle failure */ | 183 | if (scsi_add_host(host, NULL)) |
| 184 | goto cs_failed; | ||
| 185 | scsi_scan_host(host); | 185 | scsi_scan_host(host); |
| 186 | 186 | ||
| 187 | sprintf(info->node.dev_name, "scsi%d", host->host_no); | 187 | sprintf(info->node.dev_name, "scsi%d", host->host_no); |
| 188 | link->dev_node = &info->node; | 188 | link->dev_node = &info->node; |
| 189 | info->host = host; | 189 | info->host = host; |
| 190 | 190 | ||
| 191 | link->state &= ~DEV_CONFIG_PENDING; | 191 | link->state &= ~DEV_CONFIG_PENDING; |
| 192 | return; | 192 | return 0; |
| 193 | 193 | ||
| 194 | cs_failed: | 194 | cs_failed: |
| 195 | cs_error(link, last_fn, last_ret); | 195 | cs_error(link, last_fn, last_ret); |
| 196 | fdomain_release(link); | 196 | fdomain_release(link); |
| 197 | return; | 197 | return -ENODEV; |
| 198 | |||
| 199 | } /* fdomain_config */ | 198 | } /* fdomain_config */ |
| 200 | 199 | ||
| 201 | /*====================================================================*/ | 200 | /*====================================================================*/ |
| @@ -234,7 +233,7 @@ static struct pcmcia_driver fdomain_cs_driver = { | |||
| 234 | .drv = { | 233 | .drv = { |
| 235 | .name = "fdomain_cs", | 234 | .name = "fdomain_cs", |
| 236 | }, | 235 | }, |
| 237 | .probe = fdomain_attach, | 236 | .probe = fdomain_probe, |
| 238 | .remove = fdomain_detach, | 237 | .remove = fdomain_detach, |
| 239 | .id_table = fdomain_ids, | 238 | .id_table = fdomain_ids, |
| 240 | .resume = fdomain_resume, | 239 | .resume = fdomain_resume, |
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c index ce4d7d868d27..deec1c3a2619 100644 --- a/drivers/scsi/pcmcia/nsp_cs.c +++ b/drivers/scsi/pcmcia/nsp_cs.c | |||
| @@ -1593,10 +1593,11 @@ static int nsp_eh_host_reset(Scsi_Cmnd *SCpnt) | |||
| 1593 | configure the card at this point -- we wait until we receive a | 1593 | configure the card at this point -- we wait until we receive a |
| 1594 | card insertion event. | 1594 | card insertion event. |
| 1595 | ======================================================================*/ | 1595 | ======================================================================*/ |
| 1596 | static int nsp_cs_attach(struct pcmcia_device *link) | 1596 | static int nsp_cs_probe(struct pcmcia_device *link) |
| 1597 | { | 1597 | { |
| 1598 | scsi_info_t *info; | 1598 | scsi_info_t *info; |
| 1599 | nsp_hw_data *data = &nsp_data_base; | 1599 | nsp_hw_data *data = &nsp_data_base; |
| 1600 | int ret; | ||
| 1600 | 1601 | ||
| 1601 | nsp_dbg(NSP_DEBUG_INIT, "in"); | 1602 | nsp_dbg(NSP_DEBUG_INIT, "in"); |
| 1602 | 1603 | ||
| @@ -1630,10 +1631,10 @@ static int nsp_cs_attach(struct pcmcia_device *link) | |||
| 1630 | link->conf.Present = PRESENT_OPTION; | 1631 | link->conf.Present = PRESENT_OPTION; |
| 1631 | 1632 | ||
| 1632 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 1633 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 1633 | nsp_cs_config(link); | 1634 | ret = nsp_cs_config(link); |
| 1634 | 1635 | ||
| 1635 | nsp_dbg(NSP_DEBUG_INIT, "link=0x%p", link); | 1636 | nsp_dbg(NSP_DEBUG_INIT, "link=0x%p", link); |
| 1636 | return 0; | 1637 | return ret; |
| 1637 | } /* nsp_cs_attach */ | 1638 | } /* nsp_cs_attach */ |
| 1638 | 1639 | ||
| 1639 | 1640 | ||
| @@ -1665,8 +1666,9 @@ static void nsp_cs_detach(struct pcmcia_device *link) | |||
| 1665 | #define CS_CHECK(fn, ret) \ | 1666 | #define CS_CHECK(fn, ret) \ |
| 1666 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 1667 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
| 1667 | /*====================================================================*/ | 1668 | /*====================================================================*/ |
| 1668 | static void nsp_cs_config(struct pcmcia_device *link) | 1669 | static int nsp_cs_config(struct pcmcia_device *link) |
| 1669 | { | 1670 | { |
| 1671 | int ret; | ||
| 1670 | scsi_info_t *info = link->priv; | 1672 | scsi_info_t *info = link->priv; |
| 1671 | tuple_t tuple; | 1673 | tuple_t tuple; |
| 1672 | cisparse_t parse; | 1674 | cisparse_t parse; |
| @@ -1842,7 +1844,10 @@ static void nsp_cs_config(struct pcmcia_device *link) | |||
| 1842 | 1844 | ||
| 1843 | 1845 | ||
| 1844 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,74)) | 1846 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,74)) |
| 1845 | scsi_add_host (host, NULL); | 1847 | ret = scsi_add_host (host, NULL); |
| 1848 | if (ret) | ||
| 1849 | goto cs_failed; | ||
| 1850 | |||
| 1846 | scsi_scan_host(host); | 1851 | scsi_scan_host(host); |
| 1847 | 1852 | ||
| 1848 | snprintf(info->node.dev_name, sizeof(info->node.dev_name), "scsi%d", host->host_no); | 1853 | snprintf(info->node.dev_name, sizeof(info->node.dev_name), "scsi%d", host->host_no); |
| @@ -1917,14 +1922,14 @@ static void nsp_cs_config(struct pcmcia_device *link) | |||
| 1917 | printk("\n"); | 1922 | printk("\n"); |
| 1918 | 1923 | ||
| 1919 | link->state &= ~DEV_CONFIG_PENDING; | 1924 | link->state &= ~DEV_CONFIG_PENDING; |
| 1920 | return; | 1925 | return 0; |
| 1921 | 1926 | ||
| 1922 | cs_failed: | 1927 | cs_failed: |
| 1923 | nsp_dbg(NSP_DEBUG_INIT, "config fail"); | 1928 | nsp_dbg(NSP_DEBUG_INIT, "config fail"); |
| 1924 | cs_error(link, last_fn, last_ret); | 1929 | cs_error(link, last_fn, last_ret); |
| 1925 | nsp_cs_release(link); | 1930 | nsp_cs_release(link); |
| 1926 | 1931 | ||
| 1927 | return; | 1932 | return -ENODEV; |
| 1928 | } /* nsp_cs_config */ | 1933 | } /* nsp_cs_config */ |
| 1929 | #undef CS_CHECK | 1934 | #undef CS_CHECK |
| 1930 | 1935 | ||
| @@ -2033,7 +2038,7 @@ static struct pcmcia_driver nsp_driver = { | |||
| 2033 | .drv = { | 2038 | .drv = { |
| 2034 | .name = "nsp_cs", | 2039 | .name = "nsp_cs", |
| 2035 | }, | 2040 | }, |
| 2036 | .probe = nsp_cs_attach, | 2041 | .probe = nsp_cs_probe, |
| 2037 | .remove = nsp_cs_detach, | 2042 | .remove = nsp_cs_detach, |
| 2038 | .id_table = nsp_cs_ids, | 2043 | .id_table = nsp_cs_ids, |
| 2039 | .suspend = nsp_cs_suspend, | 2044 | .suspend = nsp_cs_suspend, |
diff --git a/drivers/scsi/pcmcia/nsp_cs.h b/drivers/scsi/pcmcia/nsp_cs.h index ce348b379f22..8908b8e5b78a 100644 --- a/drivers/scsi/pcmcia/nsp_cs.h +++ b/drivers/scsi/pcmcia/nsp_cs.h | |||
| @@ -298,7 +298,7 @@ typedef struct _nsp_hw_data { | |||
| 298 | /* Card service functions */ | 298 | /* Card service functions */ |
| 299 | static void nsp_cs_detach (struct pcmcia_device *p_dev); | 299 | static void nsp_cs_detach (struct pcmcia_device *p_dev); |
| 300 | static void nsp_cs_release(struct pcmcia_device *link); | 300 | static void nsp_cs_release(struct pcmcia_device *link); |
| 301 | static void nsp_cs_config (struct pcmcia_device *link); | 301 | static int nsp_cs_config (struct pcmcia_device *link); |
| 302 | 302 | ||
| 303 | /* Linux SCSI subsystem specific functions */ | 303 | /* Linux SCSI subsystem specific functions */ |
| 304 | static struct Scsi_Host *nsp_detect (struct scsi_host_template *sht); | 304 | static struct Scsi_Host *nsp_detect (struct scsi_host_template *sht); |
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c index a2a1c4b318e6..61c2eb03a9b5 100644 --- a/drivers/scsi/pcmcia/qlogic_stub.c +++ b/drivers/scsi/pcmcia/qlogic_stub.c | |||
| @@ -99,7 +99,7 @@ typedef struct scsi_info_t { | |||
| 99 | 99 | ||
| 100 | static void qlogic_release(struct pcmcia_device *link); | 100 | static void qlogic_release(struct pcmcia_device *link); |
| 101 | static void qlogic_detach(struct pcmcia_device *p_dev); | 101 | static void qlogic_detach(struct pcmcia_device *p_dev); |
| 102 | static void qlogic_config(struct pcmcia_device * link); | 102 | static int qlogic_config(struct pcmcia_device * link); |
| 103 | 103 | ||
| 104 | static struct Scsi_Host *qlogic_detect(struct scsi_host_template *host, | 104 | static struct Scsi_Host *qlogic_detect(struct scsi_host_template *host, |
| 105 | struct pcmcia_device *link, int qbase, int qlirq) | 105 | struct pcmcia_device *link, int qbase, int qlirq) |
| @@ -156,7 +156,7 @@ free_scsi_host: | |||
| 156 | err: | 156 | err: |
| 157 | return NULL; | 157 | return NULL; |
| 158 | } | 158 | } |
| 159 | static int qlogic_attach(struct pcmcia_device *link) | 159 | static int qlogic_probe(struct pcmcia_device *link) |
| 160 | { | 160 | { |
| 161 | scsi_info_t *info; | 161 | scsi_info_t *info; |
| 162 | 162 | ||
| @@ -179,9 +179,7 @@ static int qlogic_attach(struct pcmcia_device *link) | |||
| 179 | link->conf.Present = PRESENT_OPTION; | 179 | link->conf.Present = PRESENT_OPTION; |
| 180 | 180 | ||
| 181 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 181 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 182 | qlogic_config(link); | 182 | return qlogic_config(link); |
| 183 | |||
| 184 | return 0; | ||
| 185 | } /* qlogic_attach */ | 183 | } /* qlogic_attach */ |
| 186 | 184 | ||
| 187 | /*====================================================================*/ | 185 | /*====================================================================*/ |
| @@ -202,7 +200,7 @@ static void qlogic_detach(struct pcmcia_device *link) | |||
| 202 | #define CS_CHECK(fn, ret) \ | 200 | #define CS_CHECK(fn, ret) \ |
| 203 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 201 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
| 204 | 202 | ||
| 205 | static void qlogic_config(struct pcmcia_device * link) | 203 | static int qlogic_config(struct pcmcia_device * link) |
| 206 | { | 204 | { |
| 207 | scsi_info_t *info = link->priv; | 205 | scsi_info_t *info = link->priv; |
| 208 | tuple_t tuple; | 206 | tuple_t tuple; |
| @@ -267,21 +265,20 @@ static void qlogic_config(struct pcmcia_device * link) | |||
| 267 | 265 | ||
| 268 | if (!host) { | 266 | if (!host) { |
| 269 | printk(KERN_INFO "%s: no SCSI devices found\n", qlogic_name); | 267 | printk(KERN_INFO "%s: no SCSI devices found\n", qlogic_name); |
| 270 | goto out; | 268 | goto cs_failed; |
| 271 | } | 269 | } |
| 272 | 270 | ||
| 273 | sprintf(info->node.dev_name, "scsi%d", host->host_no); | 271 | sprintf(info->node.dev_name, "scsi%d", host->host_no); |
| 274 | link->dev_node = &info->node; | 272 | link->dev_node = &info->node; |
| 275 | info->host = host; | 273 | info->host = host; |
| 276 | 274 | ||
| 277 | out: | ||
| 278 | link->state &= ~DEV_CONFIG_PENDING; | 275 | link->state &= ~DEV_CONFIG_PENDING; |
| 279 | return; | 276 | return 0; |
| 280 | 277 | ||
| 281 | cs_failed: | 278 | cs_failed: |
| 282 | cs_error(link, last_fn, last_ret); | 279 | cs_error(link, last_fn, last_ret); |
| 283 | pcmcia_disable_device(link); | 280 | pcmcia_disable_device(link); |
| 284 | return; | 281 | return -ENODEV; |
| 285 | 282 | ||
| 286 | } /* qlogic_config */ | 283 | } /* qlogic_config */ |
| 287 | 284 | ||
| @@ -350,7 +347,7 @@ static struct pcmcia_driver qlogic_cs_driver = { | |||
| 350 | .drv = { | 347 | .drv = { |
| 351 | .name = "qlogic_cs", | 348 | .name = "qlogic_cs", |
| 352 | }, | 349 | }, |
| 353 | .probe = qlogic_attach, | 350 | .probe = qlogic_probe, |
| 354 | .remove = qlogic_detach, | 351 | .remove = qlogic_detach, |
| 355 | .id_table = qlogic_ids, | 352 | .id_table = qlogic_ids, |
| 356 | .resume = qlogic_resume, | 353 | .resume = qlogic_resume, |
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c index 49a37de68758..b4432206a881 100644 --- a/drivers/scsi/pcmcia/sym53c500_cs.c +++ b/drivers/scsi/pcmcia/sym53c500_cs.c | |||
| @@ -707,7 +707,7 @@ static struct scsi_host_template sym53c500_driver_template = { | |||
| 707 | #define CS_CHECK(fn, ret) \ | 707 | #define CS_CHECK(fn, ret) \ |
| 708 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 708 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
| 709 | 709 | ||
| 710 | static void | 710 | static int |
| 711 | SYM53C500_config(struct pcmcia_device *link) | 711 | SYM53C500_config(struct pcmcia_device *link) |
| 712 | { | 712 | { |
| 713 | struct scsi_info_t *info = link->priv; | 713 | struct scsi_info_t *info = link->priv; |
| @@ -836,7 +836,8 @@ next_entry: | |||
| 836 | 836 | ||
| 837 | scsi_scan_host(host); | 837 | scsi_scan_host(host); |
| 838 | 838 | ||
| 839 | goto out; /* SUCCESS */ | 839 | link->state &= ~DEV_CONFIG_PENDING; |
| 840 | return 0; | ||
| 840 | 841 | ||
| 841 | err_free_irq: | 842 | err_free_irq: |
| 842 | free_irq(irq_level, host); | 843 | free_irq(irq_level, host); |
| @@ -845,15 +846,13 @@ err_free_scsi: | |||
| 845 | err_release: | 846 | err_release: |
| 846 | release_region(port_base, 0x10); | 847 | release_region(port_base, 0x10); |
| 847 | printk(KERN_INFO "sym53c500_cs: no SCSI devices found\n"); | 848 | printk(KERN_INFO "sym53c500_cs: no SCSI devices found\n"); |
| 848 | |||
| 849 | out: | ||
| 850 | link->state &= ~DEV_CONFIG_PENDING; | 849 | link->state &= ~DEV_CONFIG_PENDING; |
| 851 | return; | 850 | return -ENODEV; |
| 852 | 851 | ||
| 853 | cs_failed: | 852 | cs_failed: |
| 854 | cs_error(link, last_fn, last_ret); | 853 | cs_error(link, last_fn, last_ret); |
| 855 | SYM53C500_release(link); | 854 | SYM53C500_release(link); |
| 856 | return; | 855 | return -ENODEV; |
| 857 | } /* SYM53C500_config */ | 856 | } /* SYM53C500_config */ |
| 858 | 857 | ||
| 859 | static int sym53c500_resume(struct pcmcia_device *link) | 858 | static int sym53c500_resume(struct pcmcia_device *link) |
| @@ -892,7 +891,7 @@ SYM53C500_detach(struct pcmcia_device *link) | |||
| 892 | } /* SYM53C500_detach */ | 891 | } /* SYM53C500_detach */ |
| 893 | 892 | ||
| 894 | static int | 893 | static int |
| 895 | SYM53C500_attach(struct pcmcia_device *link) | 894 | SYM53C500_probe(struct pcmcia_device *link) |
| 896 | { | 895 | { |
| 897 | struct scsi_info_t *info; | 896 | struct scsi_info_t *info; |
| 898 | 897 | ||
| @@ -915,9 +914,7 @@ SYM53C500_attach(struct pcmcia_device *link) | |||
| 915 | link->conf.Present = PRESENT_OPTION; | 914 | link->conf.Present = PRESENT_OPTION; |
| 916 | 915 | ||
| 917 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 916 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 918 | SYM53C500_config(link); | 917 | return SYM53C500_config(link); |
| 919 | |||
| 920 | return 0; | ||
| 921 | } /* SYM53C500_attach */ | 918 | } /* SYM53C500_attach */ |
| 922 | 919 | ||
| 923 | MODULE_AUTHOR("Bob Tracy <rct@frus.com>"); | 920 | MODULE_AUTHOR("Bob Tracy <rct@frus.com>"); |
| @@ -937,7 +934,7 @@ static struct pcmcia_driver sym53c500_cs_driver = { | |||
| 937 | .drv = { | 934 | .drv = { |
| 938 | .name = "sym53c500_cs", | 935 | .name = "sym53c500_cs", |
| 939 | }, | 936 | }, |
| 940 | .probe = SYM53C500_attach, | 937 | .probe = SYM53C500_probe, |
| 941 | .remove = SYM53C500_detach, | 938 | .remove = SYM53C500_detach, |
| 942 | .id_table = sym53c500_ids, | 939 | .id_table = sym53c500_ids, |
| 943 | .resume = sym53c500_resume, | 940 | .resume = sym53c500_resume, |
diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c index 1fe8cafebe38..e7875090dc4c 100644 --- a/drivers/serial/serial_cs.c +++ b/drivers/serial/serial_cs.c | |||
| @@ -113,7 +113,7 @@ struct serial_cfg_mem { | |||
| 113 | }; | 113 | }; |
| 114 | 114 | ||
| 115 | 115 | ||
| 116 | static void serial_config(struct pcmcia_device * link); | 116 | static int serial_config(struct pcmcia_device * link); |
| 117 | 117 | ||
| 118 | 118 | ||
| 119 | /*====================================================================== | 119 | /*====================================================================== |
| @@ -211,9 +211,7 @@ static int serial_probe(struct pcmcia_device *link) | |||
| 211 | link->conf.IntType = INT_MEMORY_AND_IO; | 211 | link->conf.IntType = INT_MEMORY_AND_IO; |
| 212 | 212 | ||
| 213 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 213 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 214 | serial_config(link); | 214 | return serial_config(link); |
| 215 | |||
| 216 | return 0; | ||
| 217 | } | 215 | } |
| 218 | 216 | ||
| 219 | /*====================================================================== | 217 | /*====================================================================== |
| @@ -553,7 +551,7 @@ free_cfg_mem: | |||
| 553 | 551 | ||
| 554 | ======================================================================*/ | 552 | ======================================================================*/ |
| 555 | 553 | ||
| 556 | void serial_config(struct pcmcia_device * link) | 554 | static int serial_config(struct pcmcia_device * link) |
| 557 | { | 555 | { |
| 558 | struct serial_info *info = link->priv; | 556 | struct serial_info *info = link->priv; |
| 559 | struct serial_cfg_mem *cfg_mem; | 557 | struct serial_cfg_mem *cfg_mem; |
| @@ -652,7 +650,7 @@ void serial_config(struct pcmcia_device * link) | |||
| 652 | link->dev_node = &info->node[0]; | 650 | link->dev_node = &info->node[0]; |
| 653 | link->state &= ~DEV_CONFIG_PENDING; | 651 | link->state &= ~DEV_CONFIG_PENDING; |
| 654 | kfree(cfg_mem); | 652 | kfree(cfg_mem); |
| 655 | return; | 653 | return 0; |
| 656 | 654 | ||
| 657 | cs_failed: | 655 | cs_failed: |
| 658 | cs_error(link, last_fn, last_ret); | 656 | cs_error(link, last_fn, last_ret); |
| @@ -660,6 +658,7 @@ void serial_config(struct pcmcia_device * link) | |||
| 660 | serial_remove(link); | 658 | serial_remove(link); |
| 661 | link->state &= ~DEV_CONFIG_PENDING; | 659 | link->state &= ~DEV_CONFIG_PENDING; |
| 662 | kfree(cfg_mem); | 660 | kfree(cfg_mem); |
| 661 | return -ENODEV; | ||
| 663 | } | 662 | } |
| 664 | 663 | ||
| 665 | static struct pcmcia_device_id serial_ids[] = { | 664 | static struct pcmcia_device_id serial_ids[] = { |
diff --git a/drivers/telephony/ixj_pcmcia.c b/drivers/telephony/ixj_pcmcia.c index bad68187f215..a27df6101dc6 100644 --- a/drivers/telephony/ixj_pcmcia.c +++ b/drivers/telephony/ixj_pcmcia.c | |||
| @@ -35,10 +35,10 @@ typedef struct ixj_info_t { | |||
| 35 | } ixj_info_t; | 35 | } ixj_info_t; |
| 36 | 36 | ||
| 37 | static void ixj_detach(struct pcmcia_device *p_dev); | 37 | static void ixj_detach(struct pcmcia_device *p_dev); |
| 38 | static void ixj_config(struct pcmcia_device * link); | 38 | static int ixj_config(struct pcmcia_device * link); |
| 39 | static void ixj_cs_release(struct pcmcia_device * link); | 39 | static void ixj_cs_release(struct pcmcia_device * link); |
| 40 | 40 | ||
| 41 | static int ixj_attach(struct pcmcia_device *p_dev) | 41 | static int ixj_probe(struct pcmcia_device *p_dev) |
| 42 | { | 42 | { |
| 43 | DEBUG(0, "ixj_attach()\n"); | 43 | DEBUG(0, "ixj_attach()\n"); |
| 44 | /* Create new ixj device */ | 44 | /* Create new ixj device */ |
| @@ -53,9 +53,7 @@ static int ixj_attach(struct pcmcia_device *p_dev) | |||
| 53 | memset(p_dev->priv, 0, sizeof(struct ixj_info_t)); | 53 | memset(p_dev->priv, 0, sizeof(struct ixj_info_t)); |
| 54 | 54 | ||
| 55 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 55 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 56 | ixj_config(p_dev); | 56 | return ixj_config(p_dev); |
| 57 | |||
| 58 | return 0; | ||
| 59 | } | 57 | } |
| 60 | 58 | ||
| 61 | static void ixj_detach(struct pcmcia_device *link) | 59 | static void ixj_detach(struct pcmcia_device *link) |
| @@ -133,7 +131,7 @@ static void ixj_get_serial(struct pcmcia_device * link, IXJ * j) | |||
| 133 | return; | 131 | return; |
| 134 | } | 132 | } |
| 135 | 133 | ||
| 136 | static void ixj_config(struct pcmcia_device * link) | 134 | static int ixj_config(struct pcmcia_device * link) |
| 137 | { | 135 | { |
| 138 | IXJ *j; | 136 | IXJ *j; |
| 139 | ixj_info_t *info; | 137 | ixj_info_t *info; |
| @@ -198,10 +196,11 @@ static void ixj_config(struct pcmcia_device * link) | |||
| 198 | link->dev_node = &info->node; | 196 | link->dev_node = &info->node; |
| 199 | ixj_get_serial(link, j); | 197 | ixj_get_serial(link, j); |
| 200 | link->state &= ~DEV_CONFIG_PENDING; | 198 | link->state &= ~DEV_CONFIG_PENDING; |
| 201 | return; | 199 | return 0; |
| 202 | cs_failed: | 200 | cs_failed: |
| 203 | cs_error(link, last_fn, last_ret); | 201 | cs_error(link, last_fn, last_ret); |
| 204 | ixj_cs_release(link); | 202 | ixj_cs_release(link); |
| 203 | return -ENODEV; | ||
| 205 | } | 204 | } |
| 206 | 205 | ||
| 207 | static void ixj_cs_release(struct pcmcia_device *link) | 206 | static void ixj_cs_release(struct pcmcia_device *link) |
| @@ -223,7 +222,7 @@ static struct pcmcia_driver ixj_driver = { | |||
| 223 | .drv = { | 222 | .drv = { |
| 224 | .name = "ixj_cs", | 223 | .name = "ixj_cs", |
| 225 | }, | 224 | }, |
| 226 | .probe = ixj_attach, | 225 | .probe = ixj_probe, |
| 227 | .remove = ixj_detach, | 226 | .remove = ixj_detach, |
| 228 | .id_table = ixj_ids, | 227 | .id_table = ixj_ids, |
| 229 | }; | 228 | }; |
diff --git a/drivers/usb/host/sl811_cs.c b/drivers/usb/host/sl811_cs.c index bfa8b213e137..e8b8e9a93084 100644 --- a/drivers/usb/host/sl811_cs.c +++ b/drivers/usb/host/sl811_cs.c | |||
| @@ -158,7 +158,7 @@ static void sl811_cs_release(struct pcmcia_device * link) | |||
| 158 | platform_device_unregister(&platform_dev); | 158 | platform_device_unregister(&platform_dev); |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | static void sl811_cs_config(struct pcmcia_device *link) | 161 | static int sl811_cs_config(struct pcmcia_device *link) |
| 162 | { | 162 | { |
| 163 | struct device *parent = &handle_to_dev(link); | 163 | struct device *parent = &handle_to_dev(link); |
| 164 | local_info_t *dev = link->priv; | 164 | local_info_t *dev = link->priv; |
| @@ -285,10 +285,12 @@ cs_failed: | |||
| 285 | cs_error(link, last_fn, last_ret); | 285 | cs_error(link, last_fn, last_ret); |
| 286 | sl811_cs_release(link); | 286 | sl811_cs_release(link); |
| 287 | link->state &= ~DEV_CONFIG_PENDING; | 287 | link->state &= ~DEV_CONFIG_PENDING; |
| 288 | return -ENODEV; | ||
| 288 | } | 289 | } |
| 290 | return 0; | ||
| 289 | } | 291 | } |
| 290 | 292 | ||
| 291 | static int sl811_cs_attach(struct pcmcia_device *link) | 293 | static int sl811_cs_probe(struct pcmcia_device *link) |
| 292 | { | 294 | { |
| 293 | local_info_t *local; | 295 | local_info_t *local; |
| 294 | 296 | ||
| @@ -308,9 +310,7 @@ static int sl811_cs_attach(struct pcmcia_device *link) | |||
| 308 | link->conf.IntType = INT_MEMORY_AND_IO; | 310 | link->conf.IntType = INT_MEMORY_AND_IO; |
| 309 | 311 | ||
| 310 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 312 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 311 | sl811_cs_config(link); | 313 | return sl811_cs_config(link); |
| 312 | |||
| 313 | return 0; | ||
| 314 | } | 314 | } |
| 315 | 315 | ||
| 316 | static struct pcmcia_device_id sl811_ids[] = { | 316 | static struct pcmcia_device_id sl811_ids[] = { |
| @@ -324,7 +324,7 @@ static struct pcmcia_driver sl811_cs_driver = { | |||
| 324 | .drv = { | 324 | .drv = { |
| 325 | .name = (char *)driver_name, | 325 | .name = (char *)driver_name, |
| 326 | }, | 326 | }, |
| 327 | .probe = sl811_cs_attach, | 327 | .probe = sl811_cs_probe, |
| 328 | .remove = sl811_cs_detach, | 328 | .remove = sl811_cs_detach, |
| 329 | .id_table = sl811_ids, | 329 | .id_table = sl811_ids, |
| 330 | }; | 330 | }; |
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c index 0431b8b0c1f5..923b1d0c2f1b 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c | |||
| @@ -57,7 +57,7 @@ static struct snd_card *card_list[SNDRV_CARDS]; | |||
| 57 | /* | 57 | /* |
| 58 | * prototypes | 58 | * prototypes |
| 59 | */ | 59 | */ |
| 60 | static void pdacf_config(struct pcmcia_device *link); | 60 | static int pdacf_config(struct pcmcia_device *link); |
| 61 | static void snd_pdacf_detach(struct pcmcia_device *p_dev); | 61 | static void snd_pdacf_detach(struct pcmcia_device *p_dev); |
| 62 | 62 | ||
| 63 | static void pdacf_release(struct pcmcia_device *link) | 63 | static void pdacf_release(struct pcmcia_device *link) |
| @@ -90,7 +90,7 @@ static int snd_pdacf_dev_free(struct snd_device *device) | |||
| 90 | /* | 90 | /* |
| 91 | * snd_pdacf_attach - attach callback for cs | 91 | * snd_pdacf_attach - attach callback for cs |
| 92 | */ | 92 | */ |
| 93 | static int snd_pdacf_attach(struct pcmcia_device *link) | 93 | static int snd_pdacf_probe(struct pcmcia_device *link) |
| 94 | { | 94 | { |
| 95 | int i; | 95 | int i; |
| 96 | struct snd_pdacf *pdacf; | 96 | struct snd_pdacf *pdacf; |
| @@ -149,9 +149,7 @@ static int snd_pdacf_attach(struct pcmcia_device *link) | |||
| 149 | link->conf.ConfigIndex = 1; | 149 | link->conf.ConfigIndex = 1; |
| 150 | link->conf.Present = PRESENT_OPTION; | 150 | link->conf.Present = PRESENT_OPTION; |
| 151 | 151 | ||
| 152 | pdacf_config(link); | 152 | return pdacf_config(link); |
| 153 | |||
| 154 | return 0; | ||
| 155 | } | 153 | } |
| 156 | 154 | ||
| 157 | 155 | ||
| @@ -218,7 +216,7 @@ static void snd_pdacf_detach(struct pcmcia_device *link) | |||
| 218 | #define CS_CHECK(fn, ret) \ | 216 | #define CS_CHECK(fn, ret) \ |
| 219 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 217 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
| 220 | 218 | ||
| 221 | static void pdacf_config(struct pcmcia_device *link) | 219 | static int pdacf_config(struct pcmcia_device *link) |
| 222 | { | 220 | { |
| 223 | struct snd_pdacf *pdacf = link->priv; | 221 | struct snd_pdacf *pdacf = link->priv; |
| 224 | tuple_t tuple; | 222 | tuple_t tuple; |
| @@ -230,7 +228,7 @@ static void pdacf_config(struct pcmcia_device *link) | |||
| 230 | parse = kmalloc(sizeof(*parse), GFP_KERNEL); | 228 | parse = kmalloc(sizeof(*parse), GFP_KERNEL); |
| 231 | if (! parse) { | 229 | if (! parse) { |
| 232 | snd_printk(KERN_ERR "pdacf_config: cannot allocate\n"); | 230 | snd_printk(KERN_ERR "pdacf_config: cannot allocate\n"); |
| 233 | return; | 231 | return -ENOMEM; |
| 234 | } | 232 | } |
| 235 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 233 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
| 236 | tuple.Attributes = 0; | 234 | tuple.Attributes = 0; |
| @@ -257,12 +255,13 @@ static void pdacf_config(struct pcmcia_device *link) | |||
| 257 | 255 | ||
| 258 | link->dev_node = &pdacf->node; | 256 | link->dev_node = &pdacf->node; |
| 259 | link->state &= ~DEV_CONFIG_PENDING; | 257 | link->state &= ~DEV_CONFIG_PENDING; |
| 260 | return; | 258 | return 0; |
| 261 | 259 | ||
| 262 | cs_failed: | 260 | cs_failed: |
| 263 | cs_error(link, last_fn, last_ret); | 261 | cs_error(link, last_fn, last_ret); |
| 264 | failed: | 262 | failed: |
| 265 | pcmcia_disable_device(link); | 263 | pcmcia_disable_device(link); |
| 264 | return -ENODEV; | ||
| 266 | } | 265 | } |
| 267 | 266 | ||
| 268 | #ifdef CONFIG_PM | 267 | #ifdef CONFIG_PM |
| @@ -312,7 +311,7 @@ static struct pcmcia_driver pdacf_cs_driver = { | |||
| 312 | .drv = { | 311 | .drv = { |
| 313 | .name = "snd-pdaudiocf", | 312 | .name = "snd-pdaudiocf", |
| 314 | }, | 313 | }, |
| 315 | .probe = snd_pdacf_attach, | 314 | .probe = snd_pdacf_probe, |
| 316 | .remove = snd_pdacf_detach, | 315 | .remove = snd_pdacf_detach, |
| 317 | .id_table = snd_pdacf_ids, | 316 | .id_table = snd_pdacf_ids, |
| 318 | #ifdef CONFIG_PM | 317 | #ifdef CONFIG_PM |
diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c index f6eed4259d17..4004b35e8af5 100644 --- a/sound/pcmcia/vx/vxpocket.c +++ b/sound/pcmcia/vx/vxpocket.c | |||
| @@ -208,7 +208,7 @@ static int snd_vxpocket_assign_resources(struct vx_core *chip, int port, int irq | |||
| 208 | #define CS_CHECK(fn, ret) \ | 208 | #define CS_CHECK(fn, ret) \ |
| 209 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 209 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
| 210 | 210 | ||
| 211 | static void vxpocket_config(struct pcmcia_device *link) | 211 | static int vxpocket_config(struct pcmcia_device *link) |
| 212 | { | 212 | { |
| 213 | struct vx_core *chip = link->priv; | 213 | struct vx_core *chip = link->priv; |
| 214 | struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip; | 214 | struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip; |
| @@ -221,7 +221,7 @@ static void vxpocket_config(struct pcmcia_device *link) | |||
| 221 | parse = kmalloc(sizeof(*parse), GFP_KERNEL); | 221 | parse = kmalloc(sizeof(*parse), GFP_KERNEL); |
| 222 | if (! parse) { | 222 | if (! parse) { |
| 223 | snd_printk(KERN_ERR "vx: cannot allocate\n"); | 223 | snd_printk(KERN_ERR "vx: cannot allocate\n"); |
| 224 | return; | 224 | return -ENOMEM; |
| 225 | } | 225 | } |
| 226 | tuple.Attributes = 0; | 226 | tuple.Attributes = 0; |
| 227 | tuple.TupleData = (cisdata_t *)buf; | 227 | tuple.TupleData = (cisdata_t *)buf; |
| @@ -265,13 +265,14 @@ static void vxpocket_config(struct pcmcia_device *link) | |||
| 265 | link->dev_node = &vxp->node; | 265 | link->dev_node = &vxp->node; |
| 266 | link->state &= ~DEV_CONFIG_PENDING; | 266 | link->state &= ~DEV_CONFIG_PENDING; |
| 267 | kfree(parse); | 267 | kfree(parse); |
| 268 | return; | 268 | return 9; |
| 269 | 269 | ||
| 270 | cs_failed: | 270 | cs_failed: |
| 271 | cs_error(link, last_fn, last_ret); | 271 | cs_error(link, last_fn, last_ret); |
| 272 | failed: | 272 | failed: |
| 273 | pcmcia_disable_device(link); | 273 | pcmcia_disable_device(link); |
| 274 | kfree(parse); | 274 | kfree(parse); |
| 275 | return -ENODEV; | ||
| 275 | } | 276 | } |
| 276 | 277 | ||
| 277 | #ifdef CONFIG_PM | 278 | #ifdef CONFIG_PM |
| @@ -311,7 +312,7 @@ static int vxp_resume(struct pcmcia_device *link) | |||
| 311 | 312 | ||
| 312 | /* | 313 | /* |
| 313 | */ | 314 | */ |
| 314 | static int vxpocket_attach(struct pcmcia_device *p_dev) | 315 | static int vxpocket_probe(struct pcmcia_device *p_dev) |
| 315 | { | 316 | { |
| 316 | struct snd_card *card; | 317 | struct snd_card *card; |
| 317 | struct snd_vxpocket *vxp; | 318 | struct snd_vxpocket *vxp; |
| @@ -349,9 +350,7 @@ static int vxpocket_attach(struct pcmcia_device *p_dev) | |||
| 349 | vxp->p_dev = p_dev; | 350 | vxp->p_dev = p_dev; |
| 350 | vxp->p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 351 | vxp->p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 351 | 352 | ||
| 352 | vxpocket_config(p_dev); | 353 | return vxpocket_config(p_dev); |
| 353 | |||
| 354 | return 0; | ||
| 355 | } | 354 | } |
| 356 | 355 | ||
| 357 | static void vxpocket_detach(struct pcmcia_device *link) | 356 | static void vxpocket_detach(struct pcmcia_device *link) |
| @@ -387,7 +386,7 @@ static struct pcmcia_driver vxp_cs_driver = { | |||
| 387 | .drv = { | 386 | .drv = { |
| 388 | .name = "snd-vxpocket", | 387 | .name = "snd-vxpocket", |
| 389 | }, | 388 | }, |
| 390 | .probe = vxpocket_attach, | 389 | .probe = vxpocket_probe, |
| 391 | .remove = vxpocket_detach, | 390 | .remove = vxpocket_detach, |
| 392 | .id_table = vxp_ids, | 391 | .id_table = vxp_ids, |
| 393 | #ifdef CONFIG_PM | 392 | #ifdef CONFIG_PM |
