PCI: change device runtime PM settings for probe and remove
authorAlan Stern <stern@rowland.harvard.edu>
Tue, 8 Jun 2010 19:23:51 +0000 (15:23 -0400)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Fri, 30 Jul 2010 16:29:09 +0000 (09:29 -0700)
commitf3ec4f87d607f40497afdb5ac03f11e2ea253d52
treeb485337aee10cb1c0fcb1593d8947b5370aa73ff
parenta2dccdb2055abeb8a7ce8e45e5f83de9c980a00c
PCI: change device runtime PM settings for probe and remove

This patch (as1388) changes the way the PCI core handles runtime PM
settings when probing or unbinding drivers.  Now the core will make
sure the device is enabled for runtime PM, with a usage count >= 1,
when a driver is probed.  It does the same when calling a driver's
remove method.

If the driver wants to use runtime PM, all it has to do is call
pm_runtime_pu_noidle() near the end of its probe routine (to cancel
the core's usage increment) and pm_runtime_get_noresume() near the
start of its remove routine (to restore the usage count).  It does not
need to mess around with setting the runtime state to enabled,
disabled, active, or suspended.

The patch updates e1000e and r8169, the only PCI drivers that already
use the existing runtime PM interface.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/net/e1000e/netdev.c
drivers/net/r8169.c
drivers/pci/pci-driver.c