iwlwifi: fix dynamic loading
authorJohannes Berg <johannes.berg@intel.com>
Wed, 6 Jun 2012 07:42:57 +0000 (09:42 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 13 Jun 2012 07:00:31 +0000 (09:00 +0200)
commitff1ffb850b7ac6d0f1b085208a6630f7584e1015
tree415f871e2c642e6cdf602b702794861a6cf4de93
parentc76fe6d19b8beffe792c390c0bd215d193512f1e
iwlwifi: fix dynamic loading

Add locking to the dynamic loading code to prevent
corrupting the list if multiple device ever init at
the same time (which cannot happen for multiple PCI
devices, but could happen when different busses init
concurrently.)

Also remove a device from the list when it stops so
the list isn't left corrupted, including a fix from
Don to not crash when it was never added.

Reviewed-by: Donald H Fry <donald.h.fry@intel.com>
Tested-by: Donald H Fry <donald.h.fry@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/iwlwifi/iwl-drv.c