Lines Matching refs:idx
122 int idx = pdev->id; in sja1000_isa_probe() local
126 idx, port[idx], mem[idx], irq[idx]); in sja1000_isa_probe()
128 if (mem[idx]) { in sja1000_isa_probe()
129 if (!request_mem_region(mem[idx], iosize, DRV_NAME)) { in sja1000_isa_probe()
133 base = ioremap(mem[idx], iosize); in sja1000_isa_probe()
139 if (indirect[idx] > 0 || in sja1000_isa_probe()
140 (indirect[idx] == -1 && indirect[0] > 0)) in sja1000_isa_probe()
142 if (!request_region(port[idx], iosize, DRV_NAME)) { in sja1000_isa_probe()
155 dev->irq = irq[idx]; in sja1000_isa_probe()
157 if (mem[idx]) { in sja1000_isa_probe()
159 dev->base_addr = mem[idx]; in sja1000_isa_probe()
163 priv->reg_base = (void __iomem *)port[idx]; in sja1000_isa_probe()
164 dev->base_addr = port[idx]; in sja1000_isa_probe()
169 spin_lock_init(&indirect_lock[idx]); in sja1000_isa_probe()
176 if (clk[idx]) in sja1000_isa_probe()
177 priv->can.clock.freq = clk[idx] / 2; in sja1000_isa_probe()
183 if (ocr[idx] != 0xff) in sja1000_isa_probe()
184 priv->ocr = ocr[idx]; in sja1000_isa_probe()
190 if (cdr[idx] != 0xff) in sja1000_isa_probe()
191 priv->cdr = cdr[idx]; in sja1000_isa_probe()
199 dev->dev_id = idx; in sja1000_isa_probe()
215 if (mem[idx]) in sja1000_isa_probe()
218 if (mem[idx]) in sja1000_isa_probe()
219 release_mem_region(mem[idx], iosize); in sja1000_isa_probe()
221 release_region(port[idx], iosize); in sja1000_isa_probe()
230 int idx = pdev->id; in sja1000_isa_remove() local
234 if (mem[idx]) { in sja1000_isa_remove()
236 release_mem_region(mem[idx], SJA1000_IOSIZE); in sja1000_isa_remove()
239 release_region(port[idx], SJA1000_IOSIZE_INDIRECT); in sja1000_isa_remove()
241 release_region(port[idx], SJA1000_IOSIZE); in sja1000_isa_remove()
256 int idx, err; in sja1000_isa_init() local
258 for (idx = 0; idx < MAXDEV; idx++) { in sja1000_isa_init()
259 if ((port[idx] || mem[idx]) && irq[idx]) { in sja1000_isa_init()
260 sja1000_isa_devs[idx] = in sja1000_isa_init()
261 platform_device_alloc(DRV_NAME, idx); in sja1000_isa_init()
262 if (!sja1000_isa_devs[idx]) { in sja1000_isa_init()
266 err = platform_device_add(sja1000_isa_devs[idx]); in sja1000_isa_init()
268 platform_device_put(sja1000_isa_devs[idx]); in sja1000_isa_init()
273 DRV_NAME, idx, port[idx], mem[idx], irq[idx]); in sja1000_isa_init()
274 } else if (idx == 0 || port[idx] || mem[idx]) { in sja1000_isa_init()
292 while (--idx >= 0) { in sja1000_isa_init()
293 if (sja1000_isa_devs[idx]) in sja1000_isa_init()
294 platform_device_unregister(sja1000_isa_devs[idx]); in sja1000_isa_init()
302 int idx; in sja1000_isa_exit() local
305 for (idx = 0; idx < MAXDEV; idx++) { in sja1000_isa_exit()
306 if (sja1000_isa_devs[idx]) in sja1000_isa_exit()
307 platform_device_unregister(sja1000_isa_devs[idx]); in sja1000_isa_exit()