[PATCH] DRIVER MODEL: Get rid of the obsolete tri-level suspend/resume callbacks
[cascardo/linux.git] / drivers / net / phy / mdio_bus.c
index e75103b..ad93b0d 100644 (file)
@@ -128,18 +128,14 @@ static int mdio_bus_match(struct device *dev, struct device_driver *drv)
 /* Suspend and resume.  Copied from platform_suspend and
  * platform_resume
  */
-static int mdio_bus_suspend(struct device * dev, u32 state)
+static int mdio_bus_suspend(struct device * dev, pm_message_t state)
 {
        int ret = 0;
        struct device_driver *drv = dev->driver;
 
-       if (drv && drv->suspend) {
-               ret = drv->suspend(dev, state, SUSPEND_DISABLE);
-               if (ret == 0)
-                       ret = drv->suspend(dev, state, SUSPEND_SAVE_STATE);
-               if (ret == 0)
-                       ret = drv->suspend(dev, state, SUSPEND_POWER_DOWN);
-       }
+       if (drv && drv->suspend)
+               ret = drv->suspend(dev, state);
+
        return ret;
 }
 
@@ -148,13 +144,9 @@ static int mdio_bus_resume(struct device * dev)
        int ret = 0;
        struct device_driver *drv = dev->driver;
 
-       if (drv && drv->resume) {
-               ret = drv->resume(dev, RESUME_POWER_ON);
-               if (ret == 0)
-                       ret = drv->resume(dev, RESUME_RESTORE_STATE);
-               if (ret == 0)
-                       ret = drv->resume(dev, RESUME_ENABLE);
-       }
+       if (drv && drv->resume)
+               ret = drv->resume(dev);
+
        return ret;
 }
 
@@ -165,9 +157,12 @@ struct bus_type mdio_bus_type = {
        .resume         = mdio_bus_resume,
 };
 
-static int __init mdio_bus_init(void)
+int __init mdio_bus_init(void)
 {
        return bus_register(&mdio_bus_type);
 }
 
-subsys_initcall(mdio_bus_init);
+void mdio_bus_exit(void)
+{
+       bus_unregister(&mdio_bus_type);
+}