diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-03-20 14:35:12 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-05-10 04:23:15 -0400 |
commit | ded6a1a341cb38c4cfeb09d3d01ffe16b5c804b3 (patch) | |
tree | c430b9dc1ee04ecbe39da798524684b2db779b0f | |
parent | 317b6d63000b3cc48c43d582d76063500e531a6c (diff) |
pcmcia: dev_node removal (drivers with updated printk call)
As a second step, remove any usage of dev_node_t from drivers which
only wrote to this typedef/struct, except one printk() which can
easily be replaced by a dev_info()/dev_warn() call.
CC: Harald Welte <laforge@gnumonks.org>
CC: linux-ide@vger.kernel.org
CC: linux-wireless@vger.kernel.org
CC: netdev@vger.kernel.org
CC: linux-usb@vger.kernel.org
Acked-by: Karsten Keil <isdn@linux-pingi.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
-rw-r--r-- | drivers/char/pcmcia/cm4000_cs.c | 9 | ||||
-rw-r--r-- | drivers/char/pcmcia/synclink_cs.c | 10 | ||||
-rw-r--r-- | drivers/ide/ide-cs.c | 12 | ||||
-rw-r--r-- | drivers/isdn/hardware/avm/avm_cs.c | 60 | ||||
-rw-r--r-- | drivers/isdn/hisax/elsa_cs.c | 27 | ||||
-rw-r--r-- | drivers/isdn/hisax/sedlbauer_cs.c | 37 | ||||
-rw-r--r-- | drivers/isdn/hisax/teles_cs.c | 37 | ||||
-rw-r--r-- | drivers/net/wireless/airo_cs.c | 47 | ||||
-rw-r--r-- | drivers/usb/host/sl811_cs.c | 10 |
9 files changed, 22 insertions, 227 deletions
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c index 90b199f97bec..e7956acf2ad6 100644 --- a/drivers/char/pcmcia/cm4000_cs.c +++ b/drivers/char/pcmcia/cm4000_cs.c | |||
@@ -106,7 +106,6 @@ static int major; /* major number we get from the kernel */ | |||
106 | 106 | ||
107 | struct cm4000_dev { | 107 | struct cm4000_dev { |
108 | struct pcmcia_device *p_dev; | 108 | struct pcmcia_device *p_dev; |
109 | dev_node_t node; /* OS node (major,minor) */ | ||
110 | 109 | ||
111 | unsigned char atr[MAX_ATR]; | 110 | unsigned char atr[MAX_ATR]; |
112 | unsigned char rbuf[512]; | 111 | unsigned char rbuf[512]; |
@@ -884,8 +883,7 @@ static void monitor_card(unsigned long p) | |||
884 | /* slow down warning, but prompt immediately after insertion */ | 883 | /* slow down warning, but prompt immediately after insertion */ |
885 | if (dev->cwarn == 0 || dev->cwarn == 10) { | 884 | if (dev->cwarn == 0 || dev->cwarn == 10) { |
886 | set_bit(IS_BAD_CARD, &dev->flags); | 885 | set_bit(IS_BAD_CARD, &dev->flags); |
887 | printk(KERN_WARNING MODULE_NAME ": device %s: ", | 886 | dev_warn(&dev->p_dev->dev, MODULE_NAME ": "); |
888 | dev->node.dev_name); | ||
889 | if (test_bit(IS_BAD_CSUM, &dev->flags)) { | 887 | if (test_bit(IS_BAD_CSUM, &dev->flags)) { |
890 | DEBUGP(4, dev, "ATR checksum (0x%.2x, should " | 888 | DEBUGP(4, dev, "ATR checksum (0x%.2x, should " |
891 | "be zero) failed\n", dev->atr_csum); | 889 | "be zero) failed\n", dev->atr_csum); |
@@ -1781,11 +1779,6 @@ static int cm4000_config(struct pcmcia_device * link, int devno) | |||
1781 | goto cs_release; | 1779 | goto cs_release; |
1782 | 1780 | ||
1783 | dev = link->priv; | 1781 | dev = link->priv; |
1784 | sprintf(dev->node.dev_name, DEVICE_NAME "%d", devno); | ||
1785 | dev->node.major = major; | ||
1786 | dev->node.minor = devno; | ||
1787 | dev->node.next = NULL; | ||
1788 | link->dev_node = &dev->node; | ||
1789 | 1782 | ||
1790 | return 0; | 1783 | return 0; |
1791 | 1784 | ||
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 027690b70d2c..308903ec8bf8 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c | |||
@@ -220,7 +220,6 @@ typedef struct _mgslpc_info { | |||
220 | 220 | ||
221 | /* PCMCIA support */ | 221 | /* PCMCIA support */ |
222 | struct pcmcia_device *p_dev; | 222 | struct pcmcia_device *p_dev; |
223 | dev_node_t node; | ||
224 | int stop; | 223 | int stop; |
225 | 224 | ||
226 | /* SPPP/Cisco HDLC device parts */ | 225 | /* SPPP/Cisco HDLC device parts */ |
@@ -614,13 +613,8 @@ static int mgslpc_config(struct pcmcia_device *link) | |||
614 | info->io_base = link->io.BasePort1; | 613 | info->io_base = link->io.BasePort1; |
615 | info->irq_level = link->irq; | 614 | info->irq_level = link->irq; |
616 | 615 | ||
617 | /* add to linked list of devices */ | 616 | dev_info(&link->dev, "index 0x%02x:", |
618 | sprintf(info->node.dev_name, "mgslpc0"); | 617 | link->conf.ConfigIndex); |
619 | info->node.major = info->node.minor = 0; | ||
620 | link->dev_node = &info->node; | ||
621 | |||
622 | printk(KERN_INFO "%s: index 0x%02x:", | ||
623 | info->node.dev_name, link->conf.ConfigIndex); | ||
624 | if (link->conf.Attributes & CONF_ENABLE_IRQ) | 618 | if (link->conf.Attributes & CONF_ENABLE_IRQ) |
625 | printk(", irq %d", link->irq); | 619 | printk(", irq %d", link->irq); |
626 | if (link->io.NumPorts1) | 620 | if (link->io.NumPorts1) |
diff --git a/drivers/ide/ide-cs.c b/drivers/ide/ide-cs.c index 17ad91e453e4..0b7815d2581c 100644 --- a/drivers/ide/ide-cs.c +++ b/drivers/ide/ide-cs.c | |||
@@ -65,8 +65,7 @@ MODULE_LICENSE("Dual MPL/GPL"); | |||
65 | typedef struct ide_info_t { | 65 | typedef struct ide_info_t { |
66 | struct pcmcia_device *p_dev; | 66 | struct pcmcia_device *p_dev; |
67 | struct ide_host *host; | 67 | struct ide_host *host; |
68 | int ndev; | 68 | int ndev; |
69 | dev_node_t node; | ||
70 | } ide_info_t; | 69 | } ide_info_t; |
71 | 70 | ||
72 | static void ide_release(struct pcmcia_device *); | 71 | static void ide_release(struct pcmcia_device *); |
@@ -308,13 +307,10 @@ static int ide_config(struct pcmcia_device *link) | |||
308 | goto failed; | 307 | goto failed; |
309 | 308 | ||
310 | info->ndev = 1; | 309 | info->ndev = 1; |
311 | sprintf(info->node.dev_name, "hd%c", 'a' + host->ports[0]->index * 2); | ||
312 | info->node.major = host->ports[0]->major; | ||
313 | info->node.minor = 0; | ||
314 | info->host = host; | 310 | info->host = host; |
315 | link->dev_node = &info->node; | 311 | dev_info(&link->dev, "ide-cs: hd%c: Vpp = %d.%d\n", |
316 | printk(KERN_INFO "ide-cs: %s: Vpp = %d.%d\n", | 312 | 'a' + host->ports[0]->index * 2, |
317 | info->node.dev_name, link->conf.Vpp / 10, link->conf.Vpp % 10); | 313 | link->conf.Vpp / 10, link->conf.Vpp % 10); |
318 | 314 | ||
319 | kfree(stk); | 315 | kfree(stk); |
320 | return 0; | 316 | return 0; |
diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c index 0d485f6c2194..8bbc452ff598 100644 --- a/drivers/isdn/hardware/avm/avm_cs.c +++ b/drivers/isdn/hardware/avm/avm_cs.c | |||
@@ -61,31 +61,6 @@ static void avmcs_release(struct pcmcia_device *link); | |||
61 | 61 | ||
62 | static void avmcs_detach(struct pcmcia_device *p_dev); | 62 | static void avmcs_detach(struct pcmcia_device *p_dev); |
63 | 63 | ||
64 | /* | ||
65 | A linked list of "instances" of the skeleton device. Each actual | ||
66 | PCMCIA card corresponds to one device instance, and is described | ||
67 | by one struct pcmcia_device structure (defined in ds.h). | ||
68 | |||
69 | You may not want to use a linked list for this -- for example, the | ||
70 | memory card driver uses an array of struct pcmcia_device pointers, where minor | ||
71 | device numbers are used to derive the corresponding array index. | ||
72 | */ | ||
73 | |||
74 | /* | ||
75 | A driver needs to provide a dev_node_t structure for each device | ||
76 | on a card. In some cases, there is only one device per card (for | ||
77 | example, ethernet cards, modems). In other cases, there may be | ||
78 | many actual or logical devices (SCSI adapters, memory cards with | ||
79 | multiple partitions). The dev_node_t structures need to be kept | ||
80 | in a linked list starting at the 'dev' field of a struct pcmcia_device | ||
81 | structure. We allocate them in the card's private data structure, | ||
82 | because they generally can't be allocated dynamically. | ||
83 | */ | ||
84 | |||
85 | typedef struct local_info_t { | ||
86 | dev_node_t node; | ||
87 | } local_info_t; | ||
88 | |||
89 | /*====================================================================== | 64 | /*====================================================================== |
90 | 65 | ||
91 | avmcs_attach() creates an "instance" of the driver, allocating | 66 | avmcs_attach() creates an "instance" of the driver, allocating |
@@ -100,7 +75,6 @@ typedef struct local_info_t { | |||
100 | 75 | ||
101 | static int avmcs_probe(struct pcmcia_device *p_dev) | 76 | static int avmcs_probe(struct pcmcia_device *p_dev) |
102 | { | 77 | { |
103 | local_info_t *local; | ||
104 | 78 | ||
105 | /* The io structure describes IO port mapping */ | 79 | /* The io structure describes IO port mapping */ |
106 | p_dev->io.NumPorts1 = 16; | 80 | p_dev->io.NumPorts1 = 16; |
@@ -113,16 +87,7 @@ static int avmcs_probe(struct pcmcia_device *p_dev) | |||
113 | p_dev->conf.ConfigIndex = 1; | 87 | p_dev->conf.ConfigIndex = 1; |
114 | p_dev->conf.Present = PRESENT_OPTION; | 88 | p_dev->conf.Present = PRESENT_OPTION; |
115 | 89 | ||
116 | /* Allocate space for private device-specific data */ | ||
117 | local = kzalloc(sizeof(local_info_t), GFP_KERNEL); | ||
118 | if (!local) | ||
119 | goto err; | ||
120 | p_dev->priv = local; | ||
121 | |||
122 | return avmcs_config(p_dev); | 90 | return avmcs_config(p_dev); |
123 | |||
124 | err: | ||
125 | return -ENOMEM; | ||
126 | } /* avmcs_attach */ | 91 | } /* avmcs_attach */ |
127 | 92 | ||
128 | /*====================================================================== | 93 | /*====================================================================== |
@@ -137,7 +102,6 @@ static int avmcs_probe(struct pcmcia_device *p_dev) | |||
137 | static void avmcs_detach(struct pcmcia_device *link) | 102 | static void avmcs_detach(struct pcmcia_device *link) |
138 | { | 103 | { |
139 | avmcs_release(link); | 104 | avmcs_release(link); |
140 | kfree(link->priv); | ||
141 | } /* avmcs_detach */ | 105 | } /* avmcs_detach */ |
142 | 106 | ||
143 | /*====================================================================== | 107 | /*====================================================================== |
@@ -168,14 +132,11 @@ static int avmcs_configcheck(struct pcmcia_device *p_dev, | |||
168 | 132 | ||
169 | static int avmcs_config(struct pcmcia_device *link) | 133 | static int avmcs_config(struct pcmcia_device *link) |
170 | { | 134 | { |
171 | local_info_t *dev; | ||
172 | int i = -1; | 135 | int i = -1; |
173 | char devname[128]; | 136 | char devname[128]; |
174 | int cardtype; | 137 | int cardtype; |
175 | int (*addcard)(unsigned int port, unsigned irq); | 138 | int (*addcard)(unsigned int port, unsigned irq); |
176 | 139 | ||
177 | dev = link->priv; | ||
178 | |||
179 | devname[0] = 0; | 140 | devname[0] = 0; |
180 | if (link->prod_id[1]) | 141 | if (link->prod_id[1]) |
181 | strlcpy(devname, link->prod_id[1], sizeof(devname)); | 142 | strlcpy(devname, link->prod_id[1], sizeof(devname)); |
@@ -204,15 +165,11 @@ static int avmcs_config(struct pcmcia_device *link) | |||
204 | 165 | ||
205 | } while (0); | 166 | } while (0); |
206 | 167 | ||
207 | /* At this point, the dev_node_t structure(s) should be | ||
208 | initialized and arranged in a linked list at link->dev. */ | ||
209 | |||
210 | if (devname[0]) { | 168 | if (devname[0]) { |
211 | char *s = strrchr(devname, ' '); | 169 | char *s = strrchr(devname, ' '); |
212 | if (!s) | 170 | if (!s) |
213 | s = devname; | 171 | s = devname; |
214 | else s++; | 172 | else s++; |
215 | strcpy(dev->node.dev_name, s); | ||
216 | if (strcmp("M1", s) == 0) { | 173 | if (strcmp("M1", s) == 0) { |
217 | cardtype = AVM_CARDTYPE_M1; | 174 | cardtype = AVM_CARDTYPE_M1; |
218 | } else if (strcmp("M2", s) == 0) { | 175 | } else if (strcmp("M2", s) == 0) { |
@@ -220,14 +177,8 @@ static int avmcs_config(struct pcmcia_device *link) | |||
220 | } else { | 177 | } else { |
221 | cardtype = AVM_CARDTYPE_B1; | 178 | cardtype = AVM_CARDTYPE_B1; |
222 | } | 179 | } |
223 | } else { | 180 | } else |
224 | strcpy(dev->node.dev_name, "b1"); | ||
225 | cardtype = AVM_CARDTYPE_B1; | 181 | cardtype = AVM_CARDTYPE_B1; |
226 | } | ||
227 | |||
228 | dev->node.major = 64; | ||
229 | dev->node.minor = 0; | ||
230 | link->dev_node = &dev->node; | ||
231 | 182 | ||
232 | /* If any step failed, release any partially configured state */ | 183 | /* If any step failed, release any partially configured state */ |
233 | if (i != 0) { | 184 | if (i != 0) { |
@@ -243,12 +194,11 @@ static int avmcs_config(struct pcmcia_device *link) | |||
243 | case AVM_CARDTYPE_B1: addcard = b1pcmcia_addcard_b1; break; | 194 | case AVM_CARDTYPE_B1: addcard = b1pcmcia_addcard_b1; break; |
244 | } | 195 | } |
245 | if ((i = (*addcard)(link->io.BasePort1, link->irq)) < 0) { | 196 | if ((i = (*addcard)(link->io.BasePort1, link->irq)) < 0) { |
246 | printk(KERN_ERR "avm_cs: failed to add AVM-%s-Controller at i/o %#x, irq %d\n", | 197 | dev_err(&link->dev, "avm_cs: failed to add AVM-Controller at i/o %#x, irq %d\n", |
247 | dev->node.dev_name, link->io.BasePort1, link->irq); | 198 | link->io.BasePort1, link->irq); |
248 | avmcs_release(link); | 199 | avmcs_release(link); |
249 | return -ENODEV; | 200 | return -ENODEV; |
250 | } | 201 | } |
251 | dev->node.minor = i; | ||
252 | return 0; | 202 | return 0; |
253 | 203 | ||
254 | } /* avmcs_config */ | 204 | } /* avmcs_config */ |
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c index 8e170e4b7cf2..218927e3a4ea 100644 --- a/drivers/isdn/hisax/elsa_cs.c +++ b/drivers/isdn/hisax/elsa_cs.c | |||
@@ -87,24 +87,8 @@ static void elsa_cs_release(struct pcmcia_device *link); | |||
87 | 87 | ||
88 | static void elsa_cs_detach(struct pcmcia_device *p_dev) __devexit; | 88 | static void elsa_cs_detach(struct pcmcia_device *p_dev) __devexit; |
89 | 89 | ||
90 | /* | ||
91 | A driver needs to provide a dev_node_t structure for each device | ||
92 | on a card. In some cases, there is only one device per card (for | ||
93 | example, ethernet cards, modems). In other cases, there may be | ||
94 | many actual or logical devices (SCSI adapters, memory cards with | ||
95 | multiple partitions). The dev_node_t structures need to be kept | ||
96 | in a linked list starting at the 'dev' field of a struct pcmcia_device | ||
97 | structure. We allocate them in the card's private data structure, | ||
98 | because they generally shouldn't be allocated dynamically. | ||
99 | In this case, we also provide a flag to indicate if a device is | ||
100 | "stopped" due to a power management event, or card ejection. The | ||
101 | device IO routines can use a flag like this to throttle IO to a | ||
102 | card that is not ready to accept it. | ||
103 | */ | ||
104 | |||
105 | typedef struct local_info_t { | 90 | typedef struct local_info_t { |
106 | struct pcmcia_device *p_dev; | 91 | struct pcmcia_device *p_dev; |
107 | dev_node_t node; | ||
108 | int busy; | 92 | int busy; |
109 | int cardnr; | 93 | int cardnr; |
110 | } local_info_t; | 94 | } local_info_t; |
@@ -226,16 +210,9 @@ static int __devinit elsa_cs_config(struct pcmcia_device *link) | |||
226 | if (i != 0) | 210 | if (i != 0) |
227 | goto failed; | 211 | goto failed; |
228 | 212 | ||
229 | /* At this point, the dev_node_t structure(s) should be | ||
230 | initialized and arranged in a linked list at link->dev. *//* */ | ||
231 | sprintf(dev->node.dev_name, "elsa"); | ||
232 | dev->node.major = dev->node.minor = 0x0; | ||
233 | |||
234 | link->dev_node = &dev->node; | ||
235 | |||
236 | /* Finally, report what we've done */ | 213 | /* Finally, report what we've done */ |
237 | printk(KERN_INFO "%s: index 0x%02x: ", | 214 | dev_info(&link->dev, "index 0x%02x: ", |
238 | dev->node.dev_name, link->conf.ConfigIndex); | 215 | link->conf.ConfigIndex); |
239 | if (link->conf.Attributes & CONF_ENABLE_IRQ) | 216 | if (link->conf.Attributes & CONF_ENABLE_IRQ) |
240 | printk(", irq %d", link->irq); | 217 | printk(", irq %d", link->irq); |
241 | if (link->io.NumPorts1) | 218 | if (link->io.NumPorts1) |
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c index 7778385b05b2..1f4feaab21af 100644 --- a/drivers/isdn/hisax/sedlbauer_cs.c +++ b/drivers/isdn/hisax/sedlbauer_cs.c | |||
@@ -87,32 +87,8 @@ static void sedlbauer_release(struct pcmcia_device *link); | |||
87 | 87 | ||
88 | static void sedlbauer_detach(struct pcmcia_device *p_dev) __devexit; | 88 | static void sedlbauer_detach(struct pcmcia_device *p_dev) __devexit; |
89 | 89 | ||
90 | /* | ||
91 | You'll also need to prototype all the functions that will actually | ||
92 | be used to talk to your device. See 'memory_cs' for a good example | ||
93 | of a fully self-sufficient driver; the other drivers rely more or | ||
94 | less on other parts of the kernel. | ||
95 | */ | ||
96 | |||
97 | /* | ||
98 | A driver needs to provide a dev_node_t structure for each device | ||
99 | on a card. In some cases, there is only one device per card (for | ||
100 | example, ethernet cards, modems). In other cases, there may be | ||
101 | many actual or logical devices (SCSI adapters, memory cards with | ||
102 | multiple partitions). The dev_node_t structures need to be kept | ||
103 | in a linked list starting at the 'dev' field of a struct pcmcia_device | ||
104 | structure. We allocate them in the card's private data structure, | ||
105 | because they generally shouldn't be allocated dynamically. | ||
106 | |||
107 | In this case, we also provide a flag to indicate if a device is | ||
108 | "stopped" due to a power management event, or card ejection. The | ||
109 | device IO routines can use a flag like this to throttle IO to a | ||
110 | card that is not ready to accept it. | ||
111 | */ | ||
112 | |||
113 | typedef struct local_info_t { | 90 | typedef struct local_info_t { |
114 | struct pcmcia_device *p_dev; | 91 | struct pcmcia_device *p_dev; |
115 | dev_node_t node; | ||
116 | int stop; | 92 | int stop; |
117 | int cardnr; | 93 | int cardnr; |
118 | } local_info_t; | 94 | } local_info_t; |
@@ -279,7 +255,6 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev, | |||
279 | 255 | ||
280 | static int __devinit sedlbauer_config(struct pcmcia_device *link) | 256 | static int __devinit sedlbauer_config(struct pcmcia_device *link) |
281 | { | 257 | { |
282 | local_info_t *dev = link->priv; | ||
283 | win_req_t *req; | 258 | win_req_t *req; |
284 | int ret; | 259 | int ret; |
285 | IsdnCard_t icard; | 260 | IsdnCard_t icard; |
@@ -315,17 +290,9 @@ static int __devinit sedlbauer_config(struct pcmcia_device *link) | |||
315 | if (ret) | 290 | if (ret) |
316 | goto failed; | 291 | goto failed; |
317 | 292 | ||
318 | /* | ||
319 | At this point, the dev_node_t structure(s) need to be | ||
320 | initialized and arranged in a linked list at link->dev. | ||
321 | */ | ||
322 | sprintf(dev->node.dev_name, "sedlbauer"); | ||
323 | dev->node.major = dev->node.minor = 0; | ||
324 | link->dev_node = &dev->node; | ||
325 | |||
326 | /* Finally, report what we've done */ | 293 | /* Finally, report what we've done */ |
327 | printk(KERN_INFO "%s: index 0x%02x:", | 294 | dev_info(&link->dev, "index 0x%02x:", |
328 | dev->node.dev_name, link->conf.ConfigIndex); | 295 | link->conf.ConfigIndex); |
329 | if (link->conf.Vpp) | 296 | if (link->conf.Vpp) |
330 | printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10); | 297 | printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10); |
331 | if (link->conf.Attributes & CONF_ENABLE_IRQ) | 298 | if (link->conf.Attributes & CONF_ENABLE_IRQ) |
diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c index 02dec13f25e5..5771955cc532 100644 --- a/drivers/isdn/hisax/teles_cs.c +++ b/drivers/isdn/hisax/teles_cs.c | |||
@@ -68,34 +68,8 @@ static void teles_cs_release(struct pcmcia_device *link); | |||
68 | 68 | ||
69 | static void teles_detach(struct pcmcia_device *p_dev) __devexit ; | 69 | static void teles_detach(struct pcmcia_device *p_dev) __devexit ; |
70 | 70 | ||
71 | /* | ||
72 | A linked list of "instances" of the teles_cs device. Each actual | ||
73 | PCMCIA card corresponds to one device instance, and is described | ||
74 | by one struct pcmcia_device structure (defined in ds.h). | ||
75 | |||
76 | You may not want to use a linked list for this -- for example, the | ||
77 | memory card driver uses an array of struct pcmcia_device pointers, where minor | ||
78 | device numbers are used to derive the corresponding array index. | ||
79 | */ | ||
80 | |||
81 | /* | ||
82 | A driver needs to provide a dev_node_t structure for each device | ||
83 | on a card. In some cases, there is only one device per card (for | ||
84 | example, ethernet cards, modems). In other cases, there may be | ||
85 | many actual or logical devices (SCSI adapters, memory cards with | ||
86 | multiple partitions). The dev_node_t structures need to be kept | ||
87 | in a linked list starting at the 'dev' field of a struct pcmcia_device | ||
88 | structure. We allocate them in the card's private data structure, | ||
89 | because they generally shouldn't be allocated dynamically. | ||
90 | In this case, we also provide a flag to indicate if a device is | ||
91 | "stopped" due to a power management event, or card ejection. The | ||
92 | device IO routines can use a flag like this to throttle IO to a | ||
93 | card that is not ready to accept it. | ||
94 | */ | ||
95 | |||
96 | typedef struct local_info_t { | 71 | typedef struct local_info_t { |
97 | struct pcmcia_device *p_dev; | 72 | struct pcmcia_device *p_dev; |
98 | dev_node_t node; | ||
99 | int busy; | 73 | int busy; |
100 | int cardnr; | 74 | int cardnr; |
101 | } local_info_t; | 75 | } local_info_t; |
@@ -216,16 +190,9 @@ static int __devinit teles_cs_config(struct pcmcia_device *link) | |||
216 | if (i != 0) | 190 | if (i != 0) |
217 | goto cs_failed; | 191 | goto cs_failed; |
218 | 192 | ||
219 | /* At this point, the dev_node_t structure(s) should be | ||
220 | initialized and arranged in a linked list at link->dev. *//* */ | ||
221 | sprintf(dev->node.dev_name, "teles"); | ||
222 | dev->node.major = dev->node.minor = 0x0; | ||
223 | |||
224 | link->dev_node = &dev->node; | ||
225 | |||
226 | /* Finally, report what we've done */ | 193 | /* Finally, report what we've done */ |
227 | printk(KERN_INFO "%s: index 0x%02x:", | 194 | dev_info(&link->dev, "index 0x%02x:", |
228 | dev->node.dev_name, link->conf.ConfigIndex); | 195 | link->conf.ConfigIndex); |
229 | if (link->conf.Attributes & CONF_ENABLE_IRQ) | 196 | if (link->conf.Attributes & CONF_ENABLE_IRQ) |
230 | printk(", irq %d", link->irq); | 197 | printk(", irq %d", link->irq); |
231 | if (link->io.NumPorts1) | 198 | if (link->io.NumPorts1) |
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c index 7867c51be15f..33bdc6a84e81 100644 --- a/drivers/net/wireless/airo_cs.c +++ b/drivers/net/wireless/airo_cs.c | |||
@@ -75,42 +75,7 @@ static void airo_release(struct pcmcia_device *link); | |||
75 | 75 | ||
76 | static void airo_detach(struct pcmcia_device *p_dev); | 76 | static void airo_detach(struct pcmcia_device *p_dev); |
77 | 77 | ||
78 | /* | ||
79 | You'll also need to prototype all the functions that will actually | ||
80 | be used to talk to your device. See 'pcmem_cs' for a good example | ||
81 | of a fully self-sufficient driver; the other drivers rely more or | ||
82 | less on other parts of the kernel. | ||
83 | */ | ||
84 | |||
85 | /* | ||
86 | A linked list of "instances" of the aironet device. Each actual | ||
87 | PCMCIA card corresponds to one device instance, and is described | ||
88 | by one struct pcmcia_device structure (defined in ds.h). | ||
89 | |||
90 | You may not want to use a linked list for this -- for example, the | ||
91 | memory card driver uses an array of struct pcmcia_device pointers, | ||
92 | where minor device numbers are used to derive the corresponding | ||
93 | array index. | ||
94 | */ | ||
95 | |||
96 | /* | ||
97 | A driver needs to provide a dev_node_t structure for each device | ||
98 | on a card. In some cases, there is only one device per card (for | ||
99 | example, ethernet cards, modems). In other cases, there may be | ||
100 | many actual or logical devices (SCSI adapters, memory cards with | ||
101 | multiple partitions). The dev_node_t structures need to be kept | ||
102 | in a linked list starting at the 'dev' field of a struct pcmcia_device | ||
103 | structure. We allocate them in the card's private data structure, | ||
104 | because they generally shouldn't be allocated dynamically. | ||
105 | |||
106 | In this case, we also provide a flag to indicate if a device is | ||
107 | "stopped" due to a power management event, or card ejection. The | ||
108 | device IO routines can use a flag like this to throttle IO to a | ||
109 | card that is not ready to accept it. | ||
110 | */ | ||
111 | |||
112 | typedef struct local_info_t { | 78 | typedef struct local_info_t { |
113 | dev_node_t node; | ||
114 | struct net_device *eth_dev; | 79 | struct net_device *eth_dev; |
115 | } local_info_t; | 80 | } local_info_t; |
116 | 81 | ||
@@ -311,17 +276,9 @@ static int airo_config(struct pcmcia_device *link) | |||
311 | if (!((local_info_t *)link->priv)->eth_dev) | 276 | if (!((local_info_t *)link->priv)->eth_dev) |
312 | goto failed; | 277 | goto failed; |
313 | 278 | ||
314 | /* | ||
315 | At this point, the dev_node_t structure(s) need to be | ||
316 | initialized and arranged in a linked list at link->dev_node. | ||
317 | */ | ||
318 | strcpy(dev->node.dev_name, ((local_info_t *)link->priv)->eth_dev->name); | ||
319 | dev->node.major = dev->node.minor = 0; | ||
320 | link->dev_node = &dev->node; | ||
321 | |||
322 | /* Finally, report what we've done */ | 279 | /* Finally, report what we've done */ |
323 | printk(KERN_INFO "%s: index 0x%02x: ", | 280 | dev_info(&link->dev, "index 0x%02x: ", |
324 | dev->node.dev_name, link->conf.ConfigIndex); | 281 | link->conf.ConfigIndex); |
325 | if (link->conf.Vpp) | 282 | if (link->conf.Vpp) |
326 | printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10); | 283 | printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10); |
327 | printk(", irq %d", link->irq); | 284 | printk(", irq %d", link->irq); |
diff --git a/drivers/usb/host/sl811_cs.c b/drivers/usb/host/sl811_cs.c index a712788f9b10..58cb73c8420a 100644 --- a/drivers/usb/host/sl811_cs.c +++ b/drivers/usb/host/sl811_cs.c | |||
@@ -47,7 +47,6 @@ static const char driver_name[DEV_NAME_LEN] = "sl811_cs"; | |||
47 | 47 | ||
48 | typedef struct local_info_t { | 48 | typedef struct local_info_t { |
49 | struct pcmcia_device *p_dev; | 49 | struct pcmcia_device *p_dev; |
50 | dev_node_t node; | ||
51 | } local_info_t; | 50 | } local_info_t; |
52 | 51 | ||
53 | static void sl811_cs_release(struct pcmcia_device * link); | 52 | static void sl811_cs_release(struct pcmcia_device * link); |
@@ -185,7 +184,6 @@ static int sl811_cs_config_check(struct pcmcia_device *p_dev, | |||
185 | static int sl811_cs_config(struct pcmcia_device *link) | 184 | static int sl811_cs_config(struct pcmcia_device *link) |
186 | { | 185 | { |
187 | struct device *parent = &link->dev; | 186 | struct device *parent = &link->dev; |
188 | local_info_t *dev = link->priv; | ||
189 | int ret; | 187 | int ret; |
190 | 188 | ||
191 | dev_dbg(&link->dev, "sl811_cs_config\n"); | 189 | dev_dbg(&link->dev, "sl811_cs_config\n"); |
@@ -204,12 +202,8 @@ static int sl811_cs_config(struct pcmcia_device *link) | |||
204 | if (ret) | 202 | if (ret) |
205 | goto failed; | 203 | goto failed; |
206 | 204 | ||
207 | sprintf(dev->node.dev_name, driver_name); | 205 | dev_info(&link->dev, "index 0x%02x: ", |
208 | dev->node.major = dev->node.minor = 0; | 206 | link->conf.ConfigIndex); |
209 | link->dev_node = &dev->node; | ||
210 | |||
211 | printk(KERN_INFO "%s: index 0x%02x: ", | ||
212 | dev->node.dev_name, link->conf.ConfigIndex); | ||
213 | if (link->conf.Vpp) | 207 | if (link->conf.Vpp) |
214 | printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10); | 208 | printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10); |
215 | printk(", irq %d", link->irq); | 209 | printk(", irq %d", link->irq); |