Commit a58eef7f authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://bk.arm.linux.org.uk/linux-2.5-pcmcia

into home.osdl.org:/home/torvalds/v2.5/linux
parents defec5af 5dda7b29
......@@ -796,15 +796,13 @@ static void __init isa_probe(void)
if (pnp_device_attach(dev) < 0)
continue;
printk("PNP ");
if (pnp_activate_dev(dev) < 0) {
printk("activate failed\n");
pnp_device_detach(dev);
break;
}
if (pnp_port_valid(dev, 0)) {
if (!pnp_port_valid(dev, 0)) {
printk("invalid resources ?\n");
pnp_device_detach(dev);
break;
......
......@@ -258,6 +258,7 @@ static int ti_override(struct yenta_socket *socket)
if (new != reg)
exca_writeb(socket, I365_INTCTL, new);
#if 0
/*
* If ISA interrupts don't work, then fall back to routing card
* interrupts to the PCI interrupt of the socket.
......@@ -282,6 +283,7 @@ static int ti_override(struct yenta_socket *socket)
config_writeb(socket, TI113X_DEVICE_CONTROL, devctl);
}
}
#endif
socket->socket.ops->init = ti_init;
return 0;
......@@ -327,9 +329,11 @@ static int ti1250_init(struct pcmcia_socket *sock)
struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket);
ti113x_init(sock);
ti_irqmux(socket) = config_readl(socket, TI122X_IRQMUX);
#if 0
ti_irqmux(socket) = (ti_irqmux(socket) & ~0x0f) | 0x02; /* route INTA */
if (!(ti_sysctl(socket) & TI122X_SCR_INTRTIE))
ti_irqmux(socket) |= 0x20; /* route INTB */
#endif
config_writel(socket, TI122X_IRQMUX, ti_irqmux(socket));
......
......@@ -752,6 +752,7 @@ static void yenta_close(struct pci_dev *dev)
iounmap(sock->base);
yenta_free_resources(sock);
pci_release_regions(dev);
pci_set_drvdata(dev, NULL);
}
......@@ -823,6 +824,7 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
{
struct yenta_socket *socket;
struct cardbus_override_struct *d;
int ret;
socket = kmalloc(sizeof(struct yenta_socket), GFP_KERNEL);
if (!socket)
......@@ -842,11 +844,19 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
/*
* Do some basic sanity checking..
*/
if (pci_enable_device(dev))
return -1;
if (pci_enable_device(dev)) {
ret = -EBUSY;
goto free;
}
ret = pci_request_regions(dev, "yenta_socket");
if (ret)
goto disable;
if (!pci_resource_start(dev, 0)) {
printk("No cardbus resource!\n");
return -1;
ret = -ENODEV;
goto release;
}
/*
......@@ -854,8 +864,17 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
* and request the IRQ.
*/
socket->base = ioremap(pci_resource_start(dev, 0), 0x1000);
if (!socket->base)
return -1;
if (!socket->base) {
ret = -ENOMEM;
goto release;
}
/*
* report the subsystem vendor and device for help debugging
* the irq stuff...
*/
printk(KERN_INFO "Yenta: CardBus bridge found at %s [%04x:%04x]\n",
dev->slot_name, dev->subsystem_vendor, dev->subsystem_device);
yenta_config_init(socket);
......@@ -871,9 +890,9 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
d = cardbus_override;
while (d->override) {
if ((dev->vendor == d->vendor) && (dev->device == d->device)) {
int retval = d->override(socket);
if (retval < 0)
return retval;
ret = d->override(socket);
if (ret < 0)
goto unmap;
}
d++;
}
......@@ -895,7 +914,20 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
printk("Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE));
/* Register it with the pcmcia layer.. */
return pcmcia_register_socket(&socket->socket);
ret = pcmcia_register_socket(&socket->socket);
if (ret == 0)
goto out;
unmap:
iounmap(socket->base);
release:
pci_release_regions(dev);
disable:
pci_disable_device(dev);
free:
kfree(socket);
out:
return ret;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment