]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: sdio: fix runtime PM path during driver removal
authorOhad Ben-Cohen <ohad@wizery.com>
Thu, 9 Jun 2011 23:40:27 +0000 (23:40 +0000)
committerChris Ball <cjb@laptop.org>
Sat, 25 Jun 2011 22:49:55 +0000 (18:49 -0400)
commit3255e90f70ce42c2d2189cdfd9f0ba32d860cc79
tree463c7dbb914337e1c47e1840ea86c29457dbf3bb
parent325128f9bb76711e7721d4e23f44bf681bd1bfee
mmc: sdio: fix runtime PM path during driver removal

After commit 508574f "PM / Runtime: Rework runtime PM handling
during driver removal" was introduced, the driver core stopped
incrementing the runtime PM usage counter of the device during
the invocation of the ->remove() callback.

This indirectly broke SDIO's runtime PM path during driver removal,
because no one calls _put_sync() anymore after ->remove() completes.

This means that the power of runtime-PM-managed SDIO cards is kept
high after their driver is removed (even if it was powered down
beforehand).

Fix that by directly calling _put_sync() when the last usage
counter is downref'ed by the SDIO bus.

Reported-and-tested-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/core/sdio_bus.c