aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy/ide-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/ide/legacy/ide-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/ide/legacy/ide-cs.c')
-rw-r--r--drivers/ide/legacy/ide-cs.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
index 3b5b55f85e23..70bb1b8bab09 100644
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -81,7 +81,7 @@ static const char ide_major[] = {
81}; 81};
82 82
83typedef struct ide_info_t { 83typedef struct ide_info_t {
84 dev_link_t link; 84 struct pcmcia_device *p_dev;
85 int ndev; 85 int ndev;
86 dev_node_t node; 86 dev_node_t node;
87 int hd; 87 int hd;
@@ -106,7 +106,7 @@ static void ide_detach(struct pcmcia_device *p_dev);
106static int ide_attach(struct pcmcia_device *p_dev) 106static int ide_attach(struct pcmcia_device *p_dev)
107{ 107{
108 ide_info_t *info; 108 ide_info_t *info;
109 dev_link_t *link; 109 dev_link_t *link = dev_to_instance(p_dev);
110 110
111 DEBUG(0, "ide_attach()\n"); 111 DEBUG(0, "ide_attach()\n");
112 112
@@ -114,7 +114,9 @@ static int ide_attach(struct pcmcia_device *p_dev)
114 info = kzalloc(sizeof(*info), GFP_KERNEL); 114 info = kzalloc(sizeof(*info), GFP_KERNEL);
115 if (!info) 115 if (!info)
116 return -ENOMEM; 116 return -ENOMEM;
117 link = &info->link; link->priv = info; 117
118 info->p_dev = p_dev;
119 link->priv = info;
118 120
119 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 121 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
120 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 122 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
@@ -124,9 +126,6 @@ static int ide_attach(struct pcmcia_device *p_dev)
124 link->conf.Attributes = CONF_ENABLE_IRQ; 126 link->conf.Attributes = CONF_ENABLE_IRQ;
125 link->conf.IntType = INT_MEMORY_AND_IO; 127 link->conf.IntType = INT_MEMORY_AND_IO;
126 128
127 link->handle = p_dev;
128 p_dev->instance = link;
129
130 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 129 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
131 ide_config(link); 130 ide_config(link);
132 131
@@ -326,7 +325,7 @@ static void ide_config(dev_link_t *link)
326 info->node.major = ide_major[hd]; 325 info->node.major = ide_major[hd];
327 info->node.minor = 0; 326 info->node.minor = 0;
328 info->hd = hd; 327 info->hd = hd;
329 link->dev = &info->node; 328 link->dev_node = &info->node;
330 printk(KERN_INFO "ide-cs: %s: Vpp = %d.%d\n", 329 printk(KERN_INFO "ide-cs: %s: Vpp = %d.%d\n",
331 info->node.dev_name, link->conf.Vpp / 10, link->conf.Vpp % 10); 330 info->node.dev_name, link->conf.Vpp / 10, link->conf.Vpp % 10);
332 331