aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pnp/driver.c')
-rw-r--r--drivers/pnp/driver.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c
index d3ccce706ab4..ea2cb9a8b21d 100644
--- a/drivers/pnp/driver.c
+++ b/drivers/pnp/driver.c
@@ -146,10 +146,30 @@ static int pnp_bus_match(struct device *dev, struct device_driver *drv)
146 return 1; 146 return 1;
147} 147}
148 148
149static int pnp_bus_suspend(struct device *dev, pm_message_t state)
150{
151 struct pnp_dev * pnp_dev = to_pnp_dev(dev);
152 struct pnp_driver * pnp_drv = pnp_dev->driver;
153
154 if (pnp_drv && pnp_drv->suspend)
155 return pnp_drv->suspend(pnp_dev, state);
156 return 0;
157}
158
159static void pnp_bus_resume(struct device *dev)
160{
161 struct pnp_dev * pnp_dev = to_pnp_dev(dev);
162 struct pnp_driver * pnp_drv = pnp_dev->driver;
163
164 if (pnp_drv && pnp_drv->resume)
165 pnp_drv->resume(pnp_dev);
166}
149 167
150struct bus_type pnp_bus_type = { 168struct bus_type pnp_bus_type = {
151 .name = "pnp", 169 .name = "pnp",
152 .match = pnp_bus_match, 170 .match = pnp_bus_match,
171 .suspend = pnp_bus_suspend,
172 .resume = pnp_bus_resume,
153}; 173};
154 174
155 175