Commit 4e666cea authored by Russell King's avatar Russell King

[ARM] Update AMBA suspend/resume model.

The device_driver suspend/resume methods are no longer used.  Instead,
the bus_type contains the suspend/resume methods.  Fix the AMBA bus
support for this change.
parent 8e3ac67b
...@@ -41,13 +41,35 @@ static int amba_match(struct device *dev, struct device_driver *drv) ...@@ -41,13 +41,35 @@ static int amba_match(struct device *dev, struct device_driver *drv)
return amba_lookup(pcdrv->id_table, pcdev) != NULL; return amba_lookup(pcdrv->id_table, pcdev) != NULL;
} }
static int amba_suspend(struct device *dev, u32 state)
{
struct amba_driver *drv = to_amba_driver(dev->driver);
int ret = 0;
if (dev->driver && drv->suspend)
ret = drv->suspend(to_amba_device(dev), state);
return ret;
}
static int amba_resume(struct device *dev)
{
struct amba_driver *drv = to_amba_driver(dev->driver);
int ret = 0;
if (dev->driver && drv->resume)
ret = drv->resume(to_amba_device(dev));
return ret;
}
/* /*
* Primecells are part of the Advanced Microcontroller Bus Architecture, * Primecells are part of the Advanced Microcontroller Bus Architecture,
* so we call the bus "amba". * so we call the bus "amba".
*/ */
struct bus_type amba_bustype = { static struct bus_type amba_bustype = {
.name = "amba", .name = "amba",
.match = amba_match, .match = amba_match,
.suspend = amba_suspend,
.resume = amba_resume,
}; };
static int __init amba_init(void) static int __init amba_init(void)
...@@ -84,18 +106,6 @@ static void amba_shutdown(struct device *dev) ...@@ -84,18 +106,6 @@ static void amba_shutdown(struct device *dev)
drv->shutdown(to_amba_device(dev)); drv->shutdown(to_amba_device(dev));
} }
static int amba_suspend(struct device *dev, u32 state, u32 level)
{
struct amba_driver *drv = to_amba_driver(dev->driver);
return drv->suspend(to_amba_device(dev), state, level);
}
static int amba_resume(struct device *dev, u32 level)
{
struct amba_driver *drv = to_amba_driver(dev->driver);
return drv->resume(to_amba_device(dev), level);
}
/** /**
* amba_driver_register - register an AMBA device driver * amba_driver_register - register an AMBA device driver
* @drv: amba device driver structure * @drv: amba device driver structure
...@@ -112,8 +122,6 @@ int amba_driver_register(struct amba_driver *drv) ...@@ -112,8 +122,6 @@ int amba_driver_register(struct amba_driver *drv)
SETFN(probe); SETFN(probe);
SETFN(remove); SETFN(remove);
SETFN(shutdown); SETFN(shutdown);
SETFN(suspend);
SETFN(resume);
return driver_register(&drv->drv); return driver_register(&drv->drv);
} }
......
...@@ -28,8 +28,8 @@ struct amba_driver { ...@@ -28,8 +28,8 @@ struct amba_driver {
int (*probe)(struct amba_device *, void *); int (*probe)(struct amba_device *, void *);
int (*remove)(struct amba_device *); int (*remove)(struct amba_device *);
void (*shutdown)(struct amba_device *); void (*shutdown)(struct amba_device *);
int (*suspend)(struct amba_device *, u32, u32); int (*suspend)(struct amba_device *, u32);
int (*resume)(struct amba_device *, u32); int (*resume)(struct amba_device *);
struct amba_id *id_table; struct amba_id *id_table;
}; };
......
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