]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pcmcia/yenta_socket.c
x86: convert to generic helpers for IPI function calls
[linux-2.6-omap-h63xx.git] / drivers / pcmcia / yenta_socket.c
index 9ced52ab7d14e114e64a14d1d91594323cf3106b..0ab1fb65cdc335541ae9bb0da1668686badef607 100644 (file)
@@ -12,7 +12,6 @@
  */
 #include <linux/init.h>
 #include <linux/pci.h>
-#include <linux/sched.h>
 #include <linux/workqueue.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
@@ -49,7 +48,7 @@ MODULE_PARM_DESC(pwr_irqs_off, "Force IRQs off during power-on of slot. Use only
 #define to_cycles(ns)  ((ns)/120)
 #define to_ns(cycles)  ((cycles)*120)
 
-/**
+/*
  * yenta PCI irq probing.
  * currently only used in the TI/EnE initialization code
  */
@@ -889,7 +888,7 @@ static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mas
 }
 
 
-/**
+/*
  * yenta PCI irq probing.
  * currently only used in the TI/EnE initialization code
  */
@@ -1013,7 +1012,7 @@ static void yenta_config_init(struct yenta_socket *socket)
  * invisible during PCI scans because of a misconfigured subordinate number
  * of the parent brige - some BIOSes seem to be too lazy to set it right.
  * Does the fixup carefully by checking how far it can go without conflicts.
- * See http://bugzilla.kernel.org/show_bug.cgi?id=2944 for more information.
+ * See http\://bugzilla.kernel.org/show_bug.cgi?id=2944 for more information.
  */
 static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge)
 {
@@ -1104,7 +1103,7 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
        /* prepare pcmcia_socket */
        socket->socket.ops = &yenta_socket_operations;
        socket->socket.resource_ops = &pccard_nonstatic_ops;
-       socket->socket.dev.dev = &dev->dev;
+       socket->socket.dev.parent = &dev->dev;
        socket->socket.driver_data = socket;
        socket->socket.owner = THIS_MODULE;
        socket->socket.features = SS_CAP_PAGE_REGS | SS_CAP_PCCARD;
@@ -1197,8 +1196,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 +1251,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)