ssb: Turn suspend/resume upside down
[deliverable/linux.git] / drivers / ssb / pcmcia.c
index d674cef7210dbab9df9e5c6c83c24702ed397ab8..dcaf2412bea752ec117b4e1d3c808b16913e585d 100644 (file)
@@ -684,6 +684,29 @@ static int ssb_pcmcia_cor_setup(struct ssb_bus *bus, u8 cor)
        return 0;
 }
 
+/* Initialize the PCMCIA hardware. This is called on Init and Resume. */
+int ssb_pcmcia_hardware_setup(struct ssb_bus *bus)
+{
+       int err;
+
+       if (bus->bustype != SSB_BUSTYPE_PCMCIA)
+               return 0;
+
+       /* Switch segment to a known state and sync
+        * bus->mapped_pcmcia_seg with hardware state. */
+       ssb_pcmcia_switch_segment(bus, 0);
+       /* Init the COR register. */
+       err = ssb_pcmcia_cor_setup(bus, CISREG_COR);
+       if (err)
+               return err;
+       /* Some cards also need this register to get poked. */
+       err = ssb_pcmcia_cor_setup(bus, CISREG_COR + 0x80);
+       if (err)
+               return err;
+
+       return 0;
+}
+
 void ssb_pcmcia_exit(struct ssb_bus *bus)
 {
        if (bus->bustype != SSB_BUSTYPE_PCMCIA)
@@ -699,16 +722,7 @@ int ssb_pcmcia_init(struct ssb_bus *bus)
        if (bus->bustype != SSB_BUSTYPE_PCMCIA)
                return 0;
 
-       /* Switch segment to a known state and sync
-        * bus->mapped_pcmcia_seg with hardware state. */
-       ssb_pcmcia_switch_segment(bus, 0);
-
-       /* Init the COR register. */
-       err = ssb_pcmcia_cor_setup(bus, CISREG_COR);
-       if (err)
-               goto error;
-       /* Some cards also need this register to get poked. */
-       err = ssb_pcmcia_cor_setup(bus, CISREG_COR + 0x80);
+       err = ssb_pcmcia_hardware_setup(bus);
        if (err)
                goto error;
 
This page took 0.055397 seconds and 5 git commands to generate.