Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

David Härdeman and committed by
Linus Torvalds
abd6633c a976f150

+11
+10
drivers/pnp/driver.c
··· 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); ··· 212 203 .match = pnp_bus_match, 213 204 .probe = pnp_device_probe, 214 205 .remove = pnp_device_remove, 206 + .shutdown = pnp_device_shutdown, 215 207 .suspend = pnp_bus_suspend, 216 208 .resume = pnp_bus_resume, 217 209 .dev_attrs = pnp_interface_attrs,
+1
include/linux/pnp.h
··· 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;