aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia/nsp_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-01 18:09:29 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:26:33 -0500
commite2d4096365e06b9a3799afbadc28b4519c0b3526 (patch)
tree90ec691d71f9c0309048714e359b8ba351b533f7 /drivers/scsi/pcmcia/nsp_cs.c
parentf6fbe01ac976f3ec618cd5fb71ad9ce2cfa7ab2b (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/nsp_cs.c')
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index deec1c3a2619..231f9c311c69 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -1630,7 +1630,6 @@ static int nsp_cs_probe(struct pcmcia_device *link)
1630 link->conf.IntType = INT_MEMORY_AND_IO; 1630 link->conf.IntType = INT_MEMORY_AND_IO;
1631 link->conf.Present = PRESENT_OPTION; 1631 link->conf.Present = PRESENT_OPTION;
1632 1632
1633 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
1634 ret = nsp_cs_config(link); 1633 ret = nsp_cs_config(link);
1635 1634
1636 nsp_dbg(NSP_DEBUG_INIT, "link=0x%p", link); 1635 nsp_dbg(NSP_DEBUG_INIT, "link=0x%p", link);
@@ -1648,10 +1647,8 @@ static void nsp_cs_detach(struct pcmcia_device *link)
1648{ 1647{
1649 nsp_dbg(NSP_DEBUG_INIT, "in, link=0x%p", link); 1648 nsp_dbg(NSP_DEBUG_INIT, "in, link=0x%p", link);
1650 1649
1651 if (link->state & DEV_CONFIG) { 1650 ((scsi_info_t *)link->priv)->stop = 1;
1652 ((scsi_info_t *)link->priv)->stop = 1; 1651 nsp_cs_release(link);
1653 nsp_cs_release(link);
1654 }
1655 1652
1656 kfree(link->priv); 1653 kfree(link->priv);
1657 link->priv = NULL; 1654 link->priv = NULL;
@@ -1698,9 +1695,6 @@ static int nsp_cs_config(struct pcmcia_device *link)
1698 link->conf.ConfigBase = parse.config.base; 1695 link->conf.ConfigBase = parse.config.base;
1699 link->conf.Present = parse.config.rmask[0]; 1696 link->conf.Present = parse.config.rmask[0];
1700 1697
1701 /* Configure card */
1702 link->state |= DEV_CONFIG;
1703
1704 /* Look up the current Vcc */ 1698 /* Look up the current Vcc */
1705 CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &conf)); 1699 CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &conf));
1706 1700
@@ -1921,7 +1915,6 @@ static int nsp_cs_config(struct pcmcia_device *link)
1921 req.Base+req.Size-1); 1915 req.Base+req.Size-1);
1922 printk("\n"); 1916 printk("\n");
1923 1917
1924 link->state &= ~DEV_CONFIG_PENDING;
1925 return 0; 1918 return 0;
1926 1919
1927 cs_failed: 1920 cs_failed:
@@ -2071,19 +2064,7 @@ static int __init nsp_cs_init(void)
2071static void __exit nsp_cs_exit(void) 2064static void __exit nsp_cs_exit(void)
2072{ 2065{
2073 nsp_msg(KERN_INFO, "unloading..."); 2066 nsp_msg(KERN_INFO, "unloading...");
2074
2075#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,68))
2076 pcmcia_unregister_driver(&nsp_driver); 2067 pcmcia_unregister_driver(&nsp_driver);
2077#else
2078 unregister_pcmcia_driver(&dev_info);
2079 /* XXX: this really needs to move into generic code.. */
2080 while (dev_list != NULL) {
2081 if (dev_list->state & DEV_CONFIG) {
2082 nsp_cs_release(dev_list);
2083 }
2084 nsp_cs_detach(dev_list);
2085 }
2086#endif
2087} 2068}
2088 2069
2089 2070