Commit abd6633c67925f90775bb74755f9c547e30f1f20
Committed by
Linus Torvalds
1 parent
a976f150a6
Exists in
master
and in
39 other branches
pnp: add a shutdown method to pnp drivers
The shutdown method is used by the winbond cir driver to setup the hardware for wake-from-S5. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: David Härdeman <david@hardeman.nu> Cc: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 2 changed files with 11 additions and 0 deletions Side-by-side Diff
drivers/pnp/driver.c
... | ... | @@ -135,6 +135,15 @@ |
135 | 135 | return 0; |
136 | 136 | } |
137 | 137 | |
138 | +static void pnp_device_shutdown(struct device *dev) | |
139 | +{ | |
140 | + struct pnp_dev *pnp_dev = to_pnp_dev(dev); | |
141 | + struct pnp_driver *drv = pnp_dev->driver; | |
142 | + | |
143 | + if (drv && drv->shutdown) | |
144 | + drv->shutdown(pnp_dev); | |
145 | +} | |
146 | + | |
138 | 147 | static int pnp_bus_match(struct device *dev, struct device_driver *drv) |
139 | 148 | { |
140 | 149 | struct pnp_dev *pnp_dev = to_pnp_dev(dev); |
... | ... | @@ -203,6 +212,7 @@ |
203 | 212 | .match = pnp_bus_match, |
204 | 213 | .probe = pnp_device_probe, |
205 | 214 | .remove = pnp_device_remove, |
215 | + .shutdown = pnp_device_shutdown, | |
206 | 216 | .suspend = pnp_bus_suspend, |
207 | 217 | .resume = pnp_bus_resume, |
208 | 218 | .dev_attrs = pnp_interface_attrs, |
include/linux/pnp.h
... | ... | @@ -360,6 +360,7 @@ |
360 | 360 | unsigned int flags; |
361 | 361 | int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id); |
362 | 362 | void (*remove) (struct pnp_dev *dev); |
363 | + void (*shutdown) (struct pnp_dev *dev); | |
363 | 364 | int (*suspend) (struct pnp_dev *dev, pm_message_t state); |
364 | 365 | int (*resume) (struct pnp_dev *dev); |
365 | 366 | struct device_driver driver; |