aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia/fdomain_stub.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/fdomain_stub.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/fdomain_stub.c')
-rw-r--r--drivers/scsi/pcmcia/fdomain_stub.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c
index b3cd206ad652..94dcee9f285a 100644
--- a/drivers/scsi/pcmcia/fdomain_stub.c
+++ b/drivers/scsi/pcmcia/fdomain_stub.c
@@ -73,7 +73,7 @@ static char *version =
73/*====================================================================*/ 73/*====================================================================*/
74 74
75typedef struct scsi_info_t { 75typedef struct scsi_info_t {
76 dev_link_t link; 76 struct pcmcia_device *p_dev;
77 dev_node_t node; 77 dev_node_t node;
78 struct Scsi_Host *host; 78 struct Scsi_Host *host;
79} scsi_info_t; 79} scsi_info_t;
@@ -86,7 +86,7 @@ static void fdomain_config(dev_link_t *link);
86static int fdomain_attach(struct pcmcia_device *p_dev) 86static int fdomain_attach(struct pcmcia_device *p_dev)
87{ 87{
88 scsi_info_t *info; 88 scsi_info_t *info;
89 dev_link_t *link; 89 dev_link_t *link = dev_to_instance(p_dev);
90 90
91 DEBUG(0, "fdomain_attach()\n"); 91 DEBUG(0, "fdomain_attach()\n");
92 92
@@ -94,7 +94,8 @@ static int fdomain_attach(struct pcmcia_device *p_dev)
94 info = kmalloc(sizeof(*info), GFP_KERNEL); 94 info = kmalloc(sizeof(*info), GFP_KERNEL);
95 if (!info) return -ENOMEM; 95 if (!info) return -ENOMEM;
96 memset(info, 0, sizeof(*info)); 96 memset(info, 0, sizeof(*info));
97 link = &info->link; link->priv = info; 97 info->p_dev = p_dev;
98 link->priv = info;
98 link->io.NumPorts1 = 0x10; 99 link->io.NumPorts1 = 0x10;
99 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 100 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
100 link->io.IOAddrLines = 10; 101 link->io.IOAddrLines = 10;
@@ -104,9 +105,6 @@ static int fdomain_attach(struct pcmcia_device *p_dev)
104 link->conf.IntType = INT_MEMORY_AND_IO; 105 link->conf.IntType = INT_MEMORY_AND_IO;
105 link->conf.Present = PRESENT_OPTION; 106 link->conf.Present = PRESENT_OPTION;
106 107
107 link->handle = p_dev;
108 p_dev->instance = link;
109
110 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 108 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
111 fdomain_config(link); 109 fdomain_config(link);
112 110
@@ -191,7 +189,7 @@ static void fdomain_config(dev_link_t *link)
191 scsi_scan_host(host); 189 scsi_scan_host(host);
192 190
193 sprintf(info->node.dev_name, "scsi%d", host->host_no); 191 sprintf(info->node.dev_name, "scsi%d", host->host_no);
194 link->dev = &info->node; 192 link->dev_node = &info->node;
195 info->host = host; 193 info->host = host;
196 194
197 link->state &= ~DEV_CONFIG_PENDING; 195 link->state &= ~DEV_CONFIG_PENDING;