aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/parport/parport_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/parport/parport_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/parport/parport_cs.c')
-rw-r--r--drivers/parport/parport_cs.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c
index 8d60146c721..ad2738ae222 100644
--- a/drivers/parport/parport_cs.c
+++ b/drivers/parport/parport_cs.c
@@ -81,7 +81,7 @@ static char *version =
81#define FORCE_EPP_MODE 0x08 81#define FORCE_EPP_MODE 0x08
82 82
83typedef struct parport_info_t { 83typedef struct parport_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 struct parport *port; 87 struct parport *port;
@@ -102,7 +102,7 @@ static void parport_cs_release(dev_link_t *);
102static int parport_attach(struct pcmcia_device *p_dev) 102static int parport_attach(struct pcmcia_device *p_dev)
103{ 103{
104 parport_info_t *info; 104 parport_info_t *info;
105 dev_link_t *link; 105 dev_link_t *link = dev_to_instance(p_dev);
106 106
107 DEBUG(0, "parport_attach()\n"); 107 DEBUG(0, "parport_attach()\n");
108 108
@@ -110,7 +110,8 @@ static int parport_attach(struct pcmcia_device *p_dev)
110 info = kmalloc(sizeof(*info), GFP_KERNEL); 110 info = kmalloc(sizeof(*info), GFP_KERNEL);
111 if (!info) return -ENOMEM; 111 if (!info) return -ENOMEM;
112 memset(info, 0, sizeof(*info)); 112 memset(info, 0, sizeof(*info));
113 link = &info->link; link->priv = info; 113 link->priv = info;
114 info->p_dev = p_dev;
114 115
115 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 116 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
116 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 117 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
@@ -119,9 +120,6 @@ static int parport_attach(struct pcmcia_device *p_dev)
119 link->conf.Attributes = CONF_ENABLE_IRQ; 120 link->conf.Attributes = CONF_ENABLE_IRQ;
120 link->conf.IntType = INT_MEMORY_AND_IO; 121 link->conf.IntType = INT_MEMORY_AND_IO;
121 122
122 link->handle = p_dev;
123 p_dev->instance = link;
124
125 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 123 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
126 parport_config(link); 124 parport_config(link);
127 125
@@ -239,7 +237,7 @@ void parport_config(dev_link_t *link)
239 info->node.minor = p->number; 237 info->node.minor = p->number;
240 info->port = p; 238 info->port = p;
241 strcpy(info->node.dev_name, p->name); 239 strcpy(info->node.dev_name, p->name);
242 link->dev = &info->node; 240 link->dev_node = &info->node;
243 241
244 link->state &= ~DEV_CONFIG_PENDING; 242 link->state &= ~DEV_CONFIG_PENDING;
245 return; 243 return;