blob: aac014d15ad3e6e9030c8050ee63363d38e3767f [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* $Id: ebus.c,v 1.64 2001/11/08 04:41:33 davem Exp $
2 * ebus.c: PCI to EBus bridge device.
3 *
4 * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be)
5 * Copyright (C) 1999 David S. Miller (davem@redhat.com)
6 */
7
8#include <linux/config.h>
9#include <linux/module.h>
10#include <linux/kernel.h>
11#include <linux/types.h>
12#include <linux/init.h>
13#include <linux/slab.h>
14#include <linux/string.h>
15#include <linux/interrupt.h>
16#include <linux/delay.h>
17
18#include <asm/system.h>
19#include <asm/page.h>
20#include <asm/pbm.h>
21#include <asm/ebus.h>
22#include <asm/oplib.h>
David S. Miller2b1e5972006-06-29 15:07:37 -070023#include <asm/prom.h>
24#include <asm/of_device.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070025#include <asm/bpp.h>
26#include <asm/irq.h>
27
28/* EBUS dma library. */
29
30#define EBDMA_CSR 0x00UL /* Control/Status */
31#define EBDMA_ADDR 0x04UL /* DMA Address */
32#define EBDMA_COUNT 0x08UL /* DMA Count */
33
34#define EBDMA_CSR_INT_PEND 0x00000001
35#define EBDMA_CSR_ERR_PEND 0x00000002
36#define EBDMA_CSR_DRAIN 0x00000004
37#define EBDMA_CSR_INT_EN 0x00000010
38#define EBDMA_CSR_RESET 0x00000080
39#define EBDMA_CSR_WRITE 0x00000100
40#define EBDMA_CSR_EN_DMA 0x00000200
41#define EBDMA_CSR_CYC_PEND 0x00000400
42#define EBDMA_CSR_DIAG_RD_DONE 0x00000800
43#define EBDMA_CSR_DIAG_WR_DONE 0x00001000
44#define EBDMA_CSR_EN_CNT 0x00002000
45#define EBDMA_CSR_TC 0x00004000
46#define EBDMA_CSR_DIS_CSR_DRN 0x00010000
47#define EBDMA_CSR_BURST_SZ_MASK 0x000c0000
48#define EBDMA_CSR_BURST_SZ_1 0x00080000
49#define EBDMA_CSR_BURST_SZ_4 0x00000000
50#define EBDMA_CSR_BURST_SZ_8 0x00040000
51#define EBDMA_CSR_BURST_SZ_16 0x000c0000
52#define EBDMA_CSR_DIAG_EN 0x00100000
53#define EBDMA_CSR_DIS_ERR_PEND 0x00400000
54#define EBDMA_CSR_TCI_DIS 0x00800000
55#define EBDMA_CSR_EN_NEXT 0x01000000
56#define EBDMA_CSR_DMA_ON 0x02000000
57#define EBDMA_CSR_A_LOADED 0x04000000
58#define EBDMA_CSR_NA_LOADED 0x08000000
59#define EBDMA_CSR_DEV_ID_MASK 0xf0000000
60
61#define EBUS_DMA_RESET_TIMEOUT 10000
62
63static void __ebus_dma_reset(struct ebus_dma_info *p, int no_drain)
64{
65 int i;
66 u32 val = 0;
67
68 writel(EBDMA_CSR_RESET, p->regs + EBDMA_CSR);
69 udelay(1);
70
71 if (no_drain)
72 return;
73
74 for (i = EBUS_DMA_RESET_TIMEOUT; i > 0; i--) {
75 val = readl(p->regs + EBDMA_CSR);
76
77 if (!(val & (EBDMA_CSR_DRAIN | EBDMA_CSR_CYC_PEND)))
78 break;
79 udelay(10);
80 }
81}
82
83static irqreturn_t ebus_dma_irq(int irq, void *dev_id, struct pt_regs *regs)
84{
85 struct ebus_dma_info *p = dev_id;
86 unsigned long flags;
87 u32 csr = 0;
88
89 spin_lock_irqsave(&p->lock, flags);
90 csr = readl(p->regs + EBDMA_CSR);
91 writel(csr, p->regs + EBDMA_CSR);
92 spin_unlock_irqrestore(&p->lock, flags);
93
94 if (csr & EBDMA_CSR_ERR_PEND) {
95 printk(KERN_CRIT "ebus_dma(%s): DMA error!\n", p->name);
96 p->callback(p, EBUS_DMA_EVENT_ERROR, p->client_cookie);
97 return IRQ_HANDLED;
98 } else if (csr & EBDMA_CSR_INT_PEND) {
99 p->callback(p,
100 (csr & EBDMA_CSR_TC) ?
101 EBUS_DMA_EVENT_DMA : EBUS_DMA_EVENT_DEVICE,
102 p->client_cookie);
103 return IRQ_HANDLED;
104 }
105
106 return IRQ_NONE;
107
108}
109
110int ebus_dma_register(struct ebus_dma_info *p)
111{
112 u32 csr;
113
114 if (!p->regs)
115 return -EINVAL;
116 if (p->flags & ~(EBUS_DMA_FLAG_USE_EBDMA_HANDLER |
117 EBUS_DMA_FLAG_TCI_DISABLE))
118 return -EINVAL;
119 if ((p->flags & EBUS_DMA_FLAG_USE_EBDMA_HANDLER) && !p->callback)
120 return -EINVAL;
121 if (!strlen(p->name))
122 return -EINVAL;
123
124 __ebus_dma_reset(p, 1);
125
126 csr = EBDMA_CSR_BURST_SZ_16 | EBDMA_CSR_EN_CNT;
127
128 if (p->flags & EBUS_DMA_FLAG_TCI_DISABLE)
129 csr |= EBDMA_CSR_TCI_DIS;
130
131 writel(csr, p->regs + EBDMA_CSR);
132
133 return 0;
134}
135EXPORT_SYMBOL(ebus_dma_register);
136
137int ebus_dma_irq_enable(struct ebus_dma_info *p, int on)
138{
139 unsigned long flags;
140 u32 csr;
141
142 if (on) {
143 if (p->flags & EBUS_DMA_FLAG_USE_EBDMA_HANDLER) {
144 if (request_irq(p->irq, ebus_dma_irq, SA_SHIRQ, p->name, p))
145 return -EBUSY;
146 }
147
148 spin_lock_irqsave(&p->lock, flags);
149 csr = readl(p->regs + EBDMA_CSR);
150 csr |= EBDMA_CSR_INT_EN;
151 writel(csr, p->regs + EBDMA_CSR);
152 spin_unlock_irqrestore(&p->lock, flags);
153 } else {
154 spin_lock_irqsave(&p->lock, flags);
155 csr = readl(p->regs + EBDMA_CSR);
156 csr &= ~EBDMA_CSR_INT_EN;
157 writel(csr, p->regs + EBDMA_CSR);
158 spin_unlock_irqrestore(&p->lock, flags);
159
160 if (p->flags & EBUS_DMA_FLAG_USE_EBDMA_HANDLER) {
161 free_irq(p->irq, p);
162 }
163 }
164
165 return 0;
166}
167EXPORT_SYMBOL(ebus_dma_irq_enable);
168
169void ebus_dma_unregister(struct ebus_dma_info *p)
170{
171 unsigned long flags;
172 u32 csr;
173 int irq_on = 0;
174
175 spin_lock_irqsave(&p->lock, flags);
176 csr = readl(p->regs + EBDMA_CSR);
177 if (csr & EBDMA_CSR_INT_EN) {
178 csr &= ~EBDMA_CSR_INT_EN;
179 writel(csr, p->regs + EBDMA_CSR);
180 irq_on = 1;
181 }
182 spin_unlock_irqrestore(&p->lock, flags);
183
184 if (irq_on)
185 free_irq(p->irq, p);
186}
187EXPORT_SYMBOL(ebus_dma_unregister);
188
189int ebus_dma_request(struct ebus_dma_info *p, dma_addr_t bus_addr, size_t len)
190{
191 unsigned long flags;
192 u32 csr;
193 int err;
194
195 if (len >= (1 << 24))
196 return -EINVAL;
197
198 spin_lock_irqsave(&p->lock, flags);
199 csr = readl(p->regs + EBDMA_CSR);
200 err = -EINVAL;
201 if (!(csr & EBDMA_CSR_EN_DMA))
202 goto out;
203 err = -EBUSY;
204 if (csr & EBDMA_CSR_NA_LOADED)
205 goto out;
206
207 writel(len, p->regs + EBDMA_COUNT);
208 writel(bus_addr, p->regs + EBDMA_ADDR);
209 err = 0;
210
211out:
212 spin_unlock_irqrestore(&p->lock, flags);
213
214 return err;
215}
216EXPORT_SYMBOL(ebus_dma_request);
217
218void ebus_dma_prepare(struct ebus_dma_info *p, int write)
219{
220 unsigned long flags;
221 u32 csr;
222
223 spin_lock_irqsave(&p->lock, flags);
224 __ebus_dma_reset(p, 0);
225
226 csr = (EBDMA_CSR_INT_EN |
227 EBDMA_CSR_EN_CNT |
228 EBDMA_CSR_BURST_SZ_16 |
229 EBDMA_CSR_EN_NEXT);
230
231 if (write)
232 csr |= EBDMA_CSR_WRITE;
233 if (p->flags & EBUS_DMA_FLAG_TCI_DISABLE)
234 csr |= EBDMA_CSR_TCI_DIS;
235
236 writel(csr, p->regs + EBDMA_CSR);
237
238 spin_unlock_irqrestore(&p->lock, flags);
239}
240EXPORT_SYMBOL(ebus_dma_prepare);
241
242unsigned int ebus_dma_residue(struct ebus_dma_info *p)
243{
244 return readl(p->regs + EBDMA_COUNT);
245}
246EXPORT_SYMBOL(ebus_dma_residue);
247
248unsigned int ebus_dma_addr(struct ebus_dma_info *p)
249{
250 return readl(p->regs + EBDMA_ADDR);
251}
252EXPORT_SYMBOL(ebus_dma_addr);
253
254void ebus_dma_enable(struct ebus_dma_info *p, int on)
255{
256 unsigned long flags;
257 u32 orig_csr, csr;
258
259 spin_lock_irqsave(&p->lock, flags);
260 orig_csr = csr = readl(p->regs + EBDMA_CSR);
261 if (on)
262 csr |= EBDMA_CSR_EN_DMA;
263 else
264 csr &= ~EBDMA_CSR_EN_DMA;
265 if ((orig_csr & EBDMA_CSR_EN_DMA) !=
266 (csr & EBDMA_CSR_EN_DMA))
267 writel(csr, p->regs + EBDMA_CSR);
268 spin_unlock_irqrestore(&p->lock, flags);
269}
270EXPORT_SYMBOL(ebus_dma_enable);
271
272struct linux_ebus *ebus_chain = NULL;
273
Linus Torvalds1da177e2005-04-16 15:20:36 -0700274static inline void *ebus_alloc(size_t size)
275{
276 void *mem;
277
Eric Sesterhenn91329832006-03-06 13:48:40 -0800278 mem = kzalloc(size, GFP_ATOMIC);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700279 if (!mem)
280 panic("ebus_alloc: out of memory");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700281 return mem;
282}
283
David S. Miller2b1e5972006-06-29 15:07:37 -0700284static void __init fill_ebus_child(struct device_node *dp,
285 struct linux_ebus_child *dev,
286 int non_standard_regs)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700287{
David S. Miller2b1e5972006-06-29 15:07:37 -0700288 struct of_device *op;
David S. Miller690c8fd2006-06-22 19:12:03 -0700289 int *regs;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700290 int i, len;
291
David S. Miller690c8fd2006-06-22 19:12:03 -0700292 dev->prom_node = dp;
293 printk(" (%s)", dp->name);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700294
David S. Miller690c8fd2006-06-22 19:12:03 -0700295 regs = of_get_property(dp, "reg", &len);
296 if (!regs)
297 dev->num_addrs = 0;
298 else
299 dev->num_addrs = len / sizeof(regs[0]);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700300
301 if (non_standard_regs) {
302 /* This is to handle reg properties which are not
303 * in the parent relative format. One example are
304 * children of the i2c device on CompactPCI systems.
305 *
306 * So, for such devices we just record the property
307 * raw in the child resources.
308 */
309 for (i = 0; i < dev->num_addrs; i++)
310 dev->resource[i].start = regs[i];
311 } else {
312 for (i = 0; i < dev->num_addrs; i++) {
313 int rnum = regs[i];
314 if (rnum >= dev->parent->num_addrs) {
315 prom_printf("UGH: property for %s was %d, need < %d\n",
David S. Miller690c8fd2006-06-22 19:12:03 -0700316 dp->name, len, dev->parent->num_addrs);
317 prom_halt();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700318 }
319 dev->resource[i].start = dev->parent->resource[i].start;
320 dev->resource[i].end = dev->parent->resource[i].end;
321 dev->resource[i].flags = IORESOURCE_MEM;
David S. Miller690c8fd2006-06-22 19:12:03 -0700322 dev->resource[i].name = dp->name;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700323 }
324 }
325
David S. Miller2b1e5972006-06-29 15:07:37 -0700326 op = of_find_device_by_node(dp);
327 if (!op) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700328 dev->num_irqs = 0;
David S. Miller2b1e5972006-06-29 15:07:37 -0700329 } else {
330 dev->num_irqs = op->num_irqs;
331 for (i = 0; i < dev->num_irqs; i++)
332 dev->irqs[i] = op->irqs[i];
333 }
334
335 if (!dev->num_irqs) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700336 /*
337 * Oh, well, some PROMs don't export interrupts
338 * property to children of EBus devices...
339 *
340 * Be smart about PS/2 keyboard and mouse.
341 */
David S. Miller690c8fd2006-06-22 19:12:03 -0700342 if (!strcmp(dev->parent->prom_node->name, "8042")) {
343 if (!strcmp(dev->prom_node->name, "kb_ps2")) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700344 dev->num_irqs = 1;
345 dev->irqs[0] = dev->parent->irqs[0];
346 } else {
347 dev->num_irqs = 1;
348 dev->irqs[0] = dev->parent->irqs[1];
349 }
350 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700351 }
352}
353
354static int __init child_regs_nonstandard(struct linux_ebus_device *dev)
355{
David S. Miller690c8fd2006-06-22 19:12:03 -0700356 if (!strcmp(dev->prom_node->name, "i2c") ||
357 !strcmp(dev->prom_node->name, "SUNW,lombus"))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700358 return 1;
359 return 0;
360}
361
David S. Miller2b1e5972006-06-29 15:07:37 -0700362static void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_device *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700363{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700364 struct linux_ebus_child *child;
David S. Miller2b1e5972006-06-29 15:07:37 -0700365 struct of_device *op;
366 int i, len;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700367
David S. Miller690c8fd2006-06-22 19:12:03 -0700368 dev->prom_node = dp;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700369
David S. Miller690c8fd2006-06-22 19:12:03 -0700370 printk(" [%s", dp->name);
371
David S. Miller2b1e5972006-06-29 15:07:37 -0700372 op = of_find_device_by_node(dp);
373 if (!op) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700374 dev->num_addrs = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700375 dev->num_irqs = 0;
376 } else {
David S. Miller2b1e5972006-06-29 15:07:37 -0700377 (void) of_get_property(dp, "reg", &len);
378 dev->num_addrs = len / sizeof(struct linux_prom_registers);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700379
David S. Miller2b1e5972006-06-29 15:07:37 -0700380 for (i = 0; i < dev->num_addrs; i++)
381 memcpy(&dev->resource[i],
382 &op->resource[i],
383 sizeof(struct resource));
384
385 dev->num_irqs = op->num_irqs;
386 for (i = 0; i < dev->num_irqs; i++)
387 dev->irqs[i] = op->irqs[i];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700388 }
389
David S. Millera2bd4fd2006-06-23 01:44:10 -0700390 dev->ofdev.node = dp;
391 dev->ofdev.dev.parent = &dev->bus->ofdev.dev;
392 dev->ofdev.dev.bus = &ebus_bus_type;
393 strcpy(dev->ofdev.dev.bus_id, dp->path_component_name);
394
395 /* Register with core */
396 if (of_device_register(&dev->ofdev) != 0)
397 printk(KERN_DEBUG "ebus: device registration error for %s!\n",
398 dev->ofdev.dev.bus_id);
399
David S. Miller690c8fd2006-06-22 19:12:03 -0700400 dp = dp->child;
401 if (dp) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700402 printk(" ->");
403 dev->children = ebus_alloc(sizeof(struct linux_ebus_child));
404
405 child = dev->children;
406 child->next = NULL;
407 child->parent = dev;
408 child->bus = dev->bus;
David S. Miller2b1e5972006-06-29 15:07:37 -0700409 fill_ebus_child(dp, child,
David S. Miller690c8fd2006-06-22 19:12:03 -0700410 child_regs_nonstandard(dev));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700411
David S. Miller690c8fd2006-06-22 19:12:03 -0700412 while ((dp = dp->sibling) != NULL) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700413 child->next = ebus_alloc(sizeof(struct linux_ebus_child));
414
415 child = child->next;
416 child->next = NULL;
417 child->parent = dev;
418 child->bus = dev->bus;
David S. Miller2b1e5972006-06-29 15:07:37 -0700419 fill_ebus_child(dp, child,
David S. Miller690c8fd2006-06-22 19:12:03 -0700420 child_regs_nonstandard(dev));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700421 }
422 }
423 printk("]");
424}
425
426static struct pci_dev *find_next_ebus(struct pci_dev *start, int *is_rio_p)
427{
428 struct pci_dev *pdev = start;
429
Jiri Slabyd08fa1a2005-11-06 23:39:35 -0800430 while ((pdev = pci_get_device(PCI_VENDOR_ID_SUN, PCI_ANY_ID, pdev)))
431 if (pdev->device == PCI_DEVICE_ID_SUN_EBUS ||
432 pdev->device == PCI_DEVICE_ID_SUN_RIO_EBUS)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700433 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700434
Jiri Slabyd08fa1a2005-11-06 23:39:35 -0800435 *is_rio_p = !!(pdev && (pdev->device == PCI_DEVICE_ID_SUN_RIO_EBUS));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700436
437 return pdev;
438}
439
440void __init ebus_init(void)
441{
442 struct pci_pbm_info *pbm;
443 struct linux_ebus_device *dev;
444 struct linux_ebus *ebus;
445 struct pci_dev *pdev;
446 struct pcidev_cookie *cookie;
David S. Miller690c8fd2006-06-22 19:12:03 -0700447 struct device_node *dp;
448 int is_rio;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700449 int num_ebus = 0;
450
451 pdev = find_next_ebus(NULL, &is_rio);
452 if (!pdev) {
453 printk("ebus: No EBus's found.\n");
454 return;
455 }
456
457 cookie = pdev->sysdata;
David S. Miller690c8fd2006-06-22 19:12:03 -0700458 dp = cookie->prom_node;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700459
460 ebus_chain = ebus = ebus_alloc(sizeof(struct linux_ebus));
461 ebus->next = NULL;
462 ebus->is_rio = is_rio;
463
David S. Miller690c8fd2006-06-22 19:12:03 -0700464 while (dp) {
465 struct device_node *child;
466
Linus Torvalds1da177e2005-04-16 15:20:36 -0700467 /* SUNW,pci-qfe uses four empty ebuses on it.
468 I think we should not consider them here,
469 as they have half of the properties this
470 code expects and once we do PCI hot-plug,
471 we'd have to tweak with the ebus_chain
472 in the runtime after initialization. -jj */
David S. Miller690c8fd2006-06-22 19:12:03 -0700473 if (!dp->child) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700474 pdev = find_next_ebus(pdev, &is_rio);
475 if (!pdev) {
476 if (ebus == ebus_chain) {
477 ebus_chain = NULL;
478 printk("ebus: No EBus's found.\n");
479 return;
480 }
481 break;
482 }
483 ebus->is_rio = is_rio;
484 cookie = pdev->sysdata;
David S. Miller690c8fd2006-06-22 19:12:03 -0700485 dp = cookie->prom_node;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700486 continue;
487 }
488 printk("ebus%d:", num_ebus);
489
Linus Torvalds1da177e2005-04-16 15:20:36 -0700490 ebus->index = num_ebus;
David S. Miller690c8fd2006-06-22 19:12:03 -0700491 ebus->prom_node = dp;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700492 ebus->self = pdev;
493 ebus->parent = pbm = cookie->pbm;
494
David S. Millera2bd4fd2006-06-23 01:44:10 -0700495 ebus->ofdev.node = dp;
496 ebus->ofdev.dev.parent = &pdev->dev;
497 ebus->ofdev.dev.bus = &ebus_bus_type;
498 strcpy(ebus->ofdev.dev.bus_id, dp->path_component_name);
499
500 /* Register with core */
501 if (of_device_register(&ebus->ofdev) != 0)
502 printk(KERN_DEBUG "ebus: device registration error for %s!\n",
503 ebus->ofdev.dev.bus_id);
504
505
David S. Miller690c8fd2006-06-22 19:12:03 -0700506 child = dp->child;
507 if (!child)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700508 goto next_ebus;
509
510 ebus->devices = ebus_alloc(sizeof(struct linux_ebus_device));
511
512 dev = ebus->devices;
513 dev->next = NULL;
514 dev->children = NULL;
515 dev->bus = ebus;
David S. Miller690c8fd2006-06-22 19:12:03 -0700516 fill_ebus_device(child, dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700517
David S. Miller690c8fd2006-06-22 19:12:03 -0700518 while ((child = child->sibling) != NULL) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700519 dev->next = ebus_alloc(sizeof(struct linux_ebus_device));
520
521 dev = dev->next;
522 dev->next = NULL;
523 dev->children = NULL;
524 dev->bus = ebus;
David S. Miller690c8fd2006-06-22 19:12:03 -0700525 fill_ebus_device(child, dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700526 }
527
528 next_ebus:
529 printk("\n");
530
531 pdev = find_next_ebus(pdev, &is_rio);
532 if (!pdev)
533 break;
534
535 cookie = pdev->sysdata;
David S. Miller690c8fd2006-06-22 19:12:03 -0700536 dp = cookie->prom_node;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700537
538 ebus->next = ebus_alloc(sizeof(struct linux_ebus));
539 ebus = ebus->next;
540 ebus->next = NULL;
541 ebus->is_rio = is_rio;
542 ++num_ebus;
543 }
Jiri Slabyd08fa1a2005-11-06 23:39:35 -0800544 pci_dev_put(pdev); /* XXX for the case, when ebusnd is 0, is it OK? */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700545}