diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-01 18:09:29 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:26:33 -0500 |
commit | e2d4096365e06b9a3799afbadc28b4519c0b3526 (patch) | |
tree | 90ec691d71f9c0309048714e359b8ba351b533f7 /drivers/scsi/pcmcia/sym53c500_cs.c | |
parent | f6fbe01ac976f3ec618cd5fb71ad9ce2cfa7ab2b (diff) |
[PATCH] pcmcia: use bitfield instead of p_state and state
Instead of the two status values struct pcmcia_device->p_state and state,
use descriptive bitfields. Most value-checking in drivers was invalid, as
the core now only calls the ->remove() (a.k.a. detach) function in case the
attachement _and_ configuration was successful.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/scsi/pcmcia/sym53c500_cs.c')
-rw-r--r-- | drivers/scsi/pcmcia/sym53c500_cs.c | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c index b4432206a881..9f59827707f0 100644 --- a/drivers/scsi/pcmcia/sym53c500_cs.c +++ b/drivers/scsi/pcmcia/sym53c500_cs.c | |||
@@ -736,9 +736,6 @@ SYM53C500_config(struct pcmcia_device *link) | |||
736 | (pcmcia_get_tuple_data(link, &tuple) == CS_SUCCESS)) | 736 | (pcmcia_get_tuple_data(link, &tuple) == CS_SUCCESS)) |
737 | info->manf_id = le16_to_cpu(tuple.TupleData[0]); | 737 | info->manf_id = le16_to_cpu(tuple.TupleData[0]); |
738 | 738 | ||
739 | /* Configure card */ | ||
740 | link->state |= DEV_CONFIG; | ||
741 | |||
742 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 739 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
743 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | 740 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |
744 | while (1) { | 741 | while (1) { |
@@ -836,7 +833,6 @@ next_entry: | |||
836 | 833 | ||
837 | scsi_scan_host(host); | 834 | scsi_scan_host(host); |
838 | 835 | ||
839 | link->state &= ~DEV_CONFIG_PENDING; | ||
840 | return 0; | 836 | return 0; |
841 | 837 | ||
842 | err_free_irq: | 838 | err_free_irq: |
@@ -846,7 +842,6 @@ err_free_scsi: | |||
846 | err_release: | 842 | err_release: |
847 | release_region(port_base, 0x10); | 843 | release_region(port_base, 0x10); |
848 | printk(KERN_INFO "sym53c500_cs: no SCSI devices found\n"); | 844 | printk(KERN_INFO "sym53c500_cs: no SCSI devices found\n"); |
849 | link->state &= ~DEV_CONFIG_PENDING; | ||
850 | return -ENODEV; | 845 | return -ENODEV; |
851 | 846 | ||
852 | cs_failed: | 847 | cs_failed: |
@@ -859,21 +854,19 @@ static int sym53c500_resume(struct pcmcia_device *link) | |||
859 | { | 854 | { |
860 | struct scsi_info_t *info = link->priv; | 855 | struct scsi_info_t *info = link->priv; |
861 | 856 | ||
862 | if (link->state & DEV_CONFIG) { | 857 | /* See earlier comment about manufacturer IDs. */ |
863 | /* See earlier comment about manufacturer IDs. */ | 858 | if ((info->manf_id == MANFID_MACNICA) || |
864 | if ((info->manf_id == MANFID_MACNICA) || | 859 | (info->manf_id == MANFID_PIONEER) || |
865 | (info->manf_id == MANFID_PIONEER) || | 860 | (info->manf_id == 0x0098)) { |
866 | (info->manf_id == 0x0098)) { | 861 | outb(0x80, link->io.BasePort1 + 0xd); |
867 | outb(0x80, link->io.BasePort1 + 0xd); | 862 | outb(0x24, link->io.BasePort1 + 0x9); |
868 | outb(0x24, link->io.BasePort1 + 0x9); | 863 | outb(0x04, link->io.BasePort1 + 0xd); |
869 | outb(0x04, link->io.BasePort1 + 0xd); | ||
870 | } | ||
871 | /* | ||
872 | * If things don't work after a "resume", | ||
873 | * this is a good place to start looking. | ||
874 | */ | ||
875 | SYM53C500_int_host_reset(link->io.BasePort1); | ||
876 | } | 864 | } |
865 | /* | ||
866 | * If things don't work after a "resume", | ||
867 | * this is a good place to start looking. | ||
868 | */ | ||
869 | SYM53C500_int_host_reset(link->io.BasePort1); | ||
877 | 870 | ||
878 | return 0; | 871 | return 0; |
879 | } | 872 | } |
@@ -883,8 +876,7 @@ SYM53C500_detach(struct pcmcia_device *link) | |||
883 | { | 876 | { |
884 | DEBUG(0, "SYM53C500_detach(0x%p)\n", link); | 877 | DEBUG(0, "SYM53C500_detach(0x%p)\n", link); |
885 | 878 | ||
886 | if (link->state & DEV_CONFIG) | 879 | SYM53C500_release(link); |
887 | SYM53C500_release(link); | ||
888 | 880 | ||
889 | kfree(link->priv); | 881 | kfree(link->priv); |
890 | link->priv = NULL; | 882 | link->priv = NULL; |
@@ -913,7 +905,6 @@ SYM53C500_probe(struct pcmcia_device *link) | |||
913 | link->conf.IntType = INT_MEMORY_AND_IO; | 905 | link->conf.IntType = INT_MEMORY_AND_IO; |
914 | link->conf.Present = PRESENT_OPTION; | 906 | link->conf.Present = PRESENT_OPTION; |
915 | 907 | ||
916 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | ||
917 | return SYM53C500_config(link); | 908 | return SYM53C500_config(link); |
918 | } /* SYM53C500_attach */ | 909 | } /* SYM53C500_attach */ |
919 | 910 | ||