diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-10-20 23:44:23 +0200 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-10-26 03:59:46 +0200 |
commit | 4deb7c1ed2b622b565c5330b475adc5a6cea30da (patch) | |
tree | 0ba9b06a057224e602207e9e1079d7ad8cf4c646 /drivers/pcmcia/yenta_socket.c | |
parent | [PATCH] Export soc_common_drv_pcmcia_remove to allow modular PCMCIA. (diff) | |
download | linux-4deb7c1ed2b622b565c5330b475adc5a6cea30da.tar.xz linux-4deb7c1ed2b622b565c5330b475adc5a6cea30da.zip |
[PATCH] PCMCIA: handle sysfs, PCI errors
Handle sysfs and PCI errors correctly.
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/yenta_socket.c')
-rw-r--r-- | drivers/pcmcia/yenta_socket.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 9ced52ab7d14..da471bddc972 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c @@ -1197,8 +1197,12 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i ret = pcmcia_register_socket(&socket->socket); if (ret == 0) { /* Add the yenta register attributes */ - device_create_file(&dev->dev, &dev_attr_yenta_registers); - goto out; + ret = device_create_file(&dev->dev, &dev_attr_yenta_registers); + if (ret == 0) + goto out; + + /* error path... */ + pcmcia_unregister_socket(&socket->socket); } unmap: @@ -1248,12 +1252,18 @@ static int yenta_dev_resume (struct pci_dev *dev) struct yenta_socket *socket = pci_get_drvdata(dev); if (socket) { + int rc; + pci_set_power_state(dev, 0); /* FIXME: pci_restore_state needs to have a better interface */ pci_restore_state(dev); pci_write_config_dword(dev, 16*4, socket->saved_state[0]); pci_write_config_dword(dev, 17*4, socket->saved_state[1]); - pci_enable_device(dev); + + rc = pci_enable_device(dev); + if (rc) + return rc; + pci_set_master(dev); if (socket->type && socket->type->restore_state) |