diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2008-06-05 22:45:50 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-06-06 11:29:08 -0700 |
commit | b2c8daddcbe03a22402ecf943bb88302601c6835 (patch) | |
tree | 326282263d7ef47c18e02fee77ffd586457c69e8 /net | |
parent | 39b945a37bac2b692773a470890c8ba301485b15 (diff) | |
download | linux-b2c8daddcbe03a22402ecf943bb88302601c6835.tar.gz linux-b2c8daddcbe03a22402ecf943bb88302601c6835.tar.bz2 linux-b2c8daddcbe03a22402ecf943bb88302601c6835.zip |
spi: fix refcount-related spidev oops-on-rmmod
This addresses other oopsing paths in "spidev" by changing how it manages
refcounting. It decouples the lifecycle of the per-device data from the
class device (not just the spi device):
- Use class_{create,destroy} not class_{register,unregister}.
- Use device_{create,destroy} not device_{register,unregister}.
- Free the per-device data only when TWO conditions are true:
* Driver is unbound from underlying SPI device, and
* Device is no longer open (new)
Also, spi_{get,set}_drvdata not dev_{get,set}_drvdata for simpler code.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Sebastian Siewior <bigeasy@tglx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions