aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia/nsp_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-05 04:45:09 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:15:57 -0500
commitfd238232cd0ff4840ae6946bb338502154096d88 (patch)
treed20e8f5871f7cff9d0867a84f6ba088fbffcbe28 /drivers/scsi/pcmcia/nsp_cs.c
parenta78f4dd331a4f6a396eb5849656a4a72a70a56d7 (diff)
[PATCH] pcmcia: embed dev_link_t into struct pcmcia_device
Embed dev_link_t into struct pcmcia_device(), as they basically address the same entity. The actual contents of dev_link_t will be cleaned up step by step. This patch includes a bugfix from and signed-off-by Andrew Morton. 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.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index e41e1febe895..23548fbf4898 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -1596,8 +1596,8 @@ static int nsp_eh_host_reset(Scsi_Cmnd *SCpnt)
1596static int nsp_cs_attach(struct pcmcia_device *p_dev) 1596static int nsp_cs_attach(struct pcmcia_device *p_dev)
1597{ 1597{
1598 scsi_info_t *info; 1598 scsi_info_t *info;
1599 dev_link_t *link;
1600 nsp_hw_data *data = &nsp_data_base; 1599 nsp_hw_data *data = &nsp_data_base;
1600 dev_link_t *link = dev_to_instance(p_dev);
1601 1601
1602 nsp_dbg(NSP_DEBUG_INIT, "in"); 1602 nsp_dbg(NSP_DEBUG_INIT, "in");
1603 1603
@@ -1605,7 +1605,7 @@ static int nsp_cs_attach(struct pcmcia_device *p_dev)
1605 info = kmalloc(sizeof(*info), GFP_KERNEL); 1605 info = kmalloc(sizeof(*info), GFP_KERNEL);
1606 if (info == NULL) { return -ENOMEM; } 1606 if (info == NULL) { return -ENOMEM; }
1607 memset(info, 0, sizeof(*info)); 1607 memset(info, 0, sizeof(*info));
1608 link = &info->link; 1608 info->p_dev = p_dev;
1609 link->priv = info; 1609 link->priv = info;
1610 data->ScsiInfo = info; 1610 data->ScsiInfo = info;
1611 1611
@@ -1630,9 +1630,6 @@ static int nsp_cs_attach(struct pcmcia_device *p_dev)
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->handle = p_dev;
1634 p_dev->instance = link;
1635
1636 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 1633 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
1637 nsp_cs_config(link); 1634 nsp_cs_config(link);
1638 1635
@@ -1853,12 +1850,12 @@ static void nsp_cs_config(dev_link_t *link)
1853 scsi_scan_host(host); 1850 scsi_scan_host(host);
1854 1851
1855 snprintf(info->node.dev_name, sizeof(info->node.dev_name), "scsi%d", host->host_no); 1852 snprintf(info->node.dev_name, sizeof(info->node.dev_name), "scsi%d", host->host_no);
1856 link->dev = &info->node; 1853 link->dev_node = &info->node;
1857 info->host = host; 1854 info->host = host;
1858 1855
1859#else 1856#else
1860 nsp_dbg(NSP_DEBUG_INIT, "GET_SCSI_INFO"); 1857 nsp_dbg(NSP_DEBUG_INIT, "GET_SCSI_INFO");
1861 tail = &link->dev; 1858 tail = &link->dev_node;
1862 info->ndev = 0; 1859 info->ndev = 0;
1863 1860
1864 nsp_dbg(NSP_DEBUG_INIT, "host=0x%p", host); 1861 nsp_dbg(NSP_DEBUG_INIT, "host=0x%p", host);
@@ -1962,7 +1959,7 @@ static void nsp_cs_release(dev_link_t *link)
1962#else 1959#else
1963 scsi_unregister_host(&nsp_driver_template); 1960 scsi_unregister_host(&nsp_driver_template);
1964#endif 1961#endif
1965 link->dev = NULL; 1962 link->dev_node = NULL;
1966 1963
1967 if (link->win) { 1964 if (link->win) {
1968 if (data != NULL) { 1965 if (data != NULL) {