diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2009-10-18 12:28:39 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2009-11-08 12:06:53 -0500 |
commit | aaa8cfdada648a6bae32f62df76cc60137a2b323 (patch) | |
tree | c610da3b895ed6fdcda058dc08962b0248624c98 /drivers/net/wireless/libertas/if_cs.c | |
parent | 7d2e8d00b47b973c92db4df7444d5e6d3bb945f9 (diff) |
pcmcia: use pcmcia_loop_config in misc pcmcia drivers
Use pcmcia_loop_config() in a few drivers missed during the first
round. On fmvj18x_cs.c it -- strangely -- only requries us to set
conf.ConfigIndex, which is done by the core, so include an empty
loop function which returns 0 unconditionally.
CC: David S. Miller <davem@davemloft.net>
CC: David Sterba <dsterba@suse.cz>
CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
For the ipwireless part: Acked-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net/wireless/libertas/if_cs.c')
-rw-r--r-- | drivers/net/wireless/libertas/if_cs.c | 67 |
1 files changed, 27 insertions, 40 deletions
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c index 62381768f2d5..cb40c386fc77 100644 --- a/drivers/net/wireless/libertas/if_cs.c +++ b/drivers/net/wireless/libertas/if_cs.c | |||
@@ -793,18 +793,37 @@ static void if_cs_release(struct pcmcia_device *p_dev) | |||
793 | * configure the card at this point -- we wait until we receive a card | 793 | * configure the card at this point -- we wait until we receive a card |
794 | * insertion event. | 794 | * insertion event. |
795 | */ | 795 | */ |
796 | |||
797 | static int if_cs_ioprobe(struct pcmcia_device *p_dev, | ||
798 | cistpl_cftable_entry_t *cfg, | ||
799 | cistpl_cftable_entry_t *dflt, | ||
800 | unsigned int vcc, | ||
801 | void *priv_data) | ||
802 | { | ||
803 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | ||
804 | p_dev->io.BasePort1 = cfg->io.win[0].base; | ||
805 | p_dev->io.NumPorts1 = cfg->io.win[0].len; | ||
806 | |||
807 | /* Do we need to allocate an interrupt? */ | ||
808 | if (cfg->irq.IRQInfo1) | ||
809 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; | ||
810 | |||
811 | /* IO window settings */ | ||
812 | if (cfg->io.nwin != 1) { | ||
813 | lbs_pr_err("wrong CIS (check number of IO windows)\n"); | ||
814 | return -ENODEV; | ||
815 | } | ||
816 | |||
817 | /* This reserves IO space but doesn't actually enable it */ | ||
818 | return pcmcia_request_io(p_dev, &p_dev->io); | ||
819 | } | ||
820 | |||
796 | static int if_cs_probe(struct pcmcia_device *p_dev) | 821 | static int if_cs_probe(struct pcmcia_device *p_dev) |
797 | { | 822 | { |
798 | int ret = -ENOMEM; | 823 | int ret = -ENOMEM; |
799 | unsigned int prod_id; | 824 | unsigned int prod_id; |
800 | struct lbs_private *priv; | 825 | struct lbs_private *priv; |
801 | struct if_cs_card *card; | 826 | struct if_cs_card *card; |
802 | /* CIS parsing */ | ||
803 | tuple_t tuple; | ||
804 | cisparse_t parse; | ||
805 | cistpl_cftable_entry_t *cfg = &parse.cftable_entry; | ||
806 | cistpl_io_t *io = &cfg->io; | ||
807 | u_char buf[64]; | ||
808 | 827 | ||
809 | lbs_deb_enter(LBS_DEB_CS); | 828 | lbs_deb_enter(LBS_DEB_CS); |
810 | 829 | ||
@@ -823,43 +842,11 @@ static int if_cs_probe(struct pcmcia_device *p_dev) | |||
823 | p_dev->conf.Attributes = 0; | 842 | p_dev->conf.Attributes = 0; |
824 | p_dev->conf.IntType = INT_MEMORY_AND_IO; | 843 | p_dev->conf.IntType = INT_MEMORY_AND_IO; |
825 | 844 | ||
826 | tuple.Attributes = 0; | 845 | if (pcmcia_loop_config(p_dev, if_cs_ioprobe, NULL)) { |
827 | tuple.TupleData = buf; | 846 | lbs_pr_err("error in pcmcia_loop_config\n"); |
828 | tuple.TupleDataMax = sizeof(buf); | ||
829 | tuple.TupleOffset = 0; | ||
830 | |||
831 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | ||
832 | if ((ret = pcmcia_get_first_tuple(p_dev, &tuple)) != 0 || | ||
833 | (ret = pcmcia_get_tuple_data(p_dev, &tuple)) != 0 || | ||
834 | (ret = pcmcia_parse_tuple(&tuple, &parse)) != 0) | ||
835 | { | ||
836 | lbs_pr_err("error in pcmcia_get_first_tuple etc\n"); | ||
837 | goto out1; | ||
838 | } | ||
839 | |||
840 | p_dev->conf.ConfigIndex = cfg->index; | ||
841 | |||
842 | /* Do we need to allocate an interrupt? */ | ||
843 | if (cfg->irq.IRQInfo1) { | ||
844 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; | ||
845 | } | ||
846 | |||
847 | /* IO window settings */ | ||
848 | if (cfg->io.nwin != 1) { | ||
849 | lbs_pr_err("wrong CIS (check number of IO windows)\n"); | ||
850 | ret = -ENODEV; | ||
851 | goto out1; | 847 | goto out1; |
852 | } | 848 | } |
853 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | ||
854 | p_dev->io.BasePort1 = io->win[0].base; | ||
855 | p_dev->io.NumPorts1 = io->win[0].len; | ||
856 | 849 | ||
857 | /* This reserves IO space but doesn't actually enable it */ | ||
858 | ret = pcmcia_request_io(p_dev, &p_dev->io); | ||
859 | if (ret) { | ||
860 | lbs_pr_err("error in pcmcia_request_io\n"); | ||
861 | goto out1; | ||
862 | } | ||
863 | 850 | ||
864 | /* | 851 | /* |
865 | * Allocate an interrupt line. Note that this does not assign | 852 | * Allocate an interrupt line. Note that this does not assign |