diff options
author | John W. Linville <linville@tuxdriver.com> | 2010-08-06 15:31:45 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-08-16 14:39:48 -0400 |
commit | 84c164a34ffe67908a932a2d641ec1a80c2d5435 (patch) | |
tree | 5fe5cac69497ef54d765e6fa2faaabef431ae8ee /drivers/net/wireless/b43/main.c | |
parent | 13eb670c104e15e06d38f3a210cfaf467a9c66de (diff) |
b43: move hwrng registration driver to wireless core initialization
...and unregistration to core shutdown. Previously, the driver
remained registered even when the hardware was shutdown. That
causes the driver to return -ENODEV if the b43 device is IFF_DOWN.
This change causes the driver to disappear in that case, allowing
/dev/hwrng to still function if another hwrng device is available.
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43/main.c')
-rw-r--r-- | drivers/net/wireless/b43/main.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 294b68895822..a3e2f2bfe3a7 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -4255,6 +4255,10 @@ static void b43_wireless_core_exit(struct b43_wldev *dev) | |||
4255 | B43_WARN_ON(dev && b43_status(dev) > B43_STAT_INITIALIZED); | 4255 | B43_WARN_ON(dev && b43_status(dev) > B43_STAT_INITIALIZED); |
4256 | if (!dev || b43_status(dev) != B43_STAT_INITIALIZED) | 4256 | if (!dev || b43_status(dev) != B43_STAT_INITIALIZED) |
4257 | return; | 4257 | return; |
4258 | |||
4259 | /* Unregister HW RNG driver */ | ||
4260 | b43_rng_exit(dev->wl); | ||
4261 | |||
4258 | b43_set_status(dev, B43_STAT_UNINIT); | 4262 | b43_set_status(dev, B43_STAT_UNINIT); |
4259 | 4263 | ||
4260 | /* Stop the microcode PSM. */ | 4264 | /* Stop the microcode PSM. */ |
@@ -4384,6 +4388,9 @@ static int b43_wireless_core_init(struct b43_wldev *dev) | |||
4384 | 4388 | ||
4385 | b43_set_status(dev, B43_STAT_INITIALIZED); | 4389 | b43_set_status(dev, B43_STAT_INITIALIZED); |
4386 | 4390 | ||
4391 | /* Register HW RNG driver */ | ||
4392 | b43_rng_init(dev->wl); | ||
4393 | |||
4387 | out: | 4394 | out: |
4388 | return err; | 4395 | return err; |
4389 | 4396 | ||
@@ -4989,7 +4996,6 @@ static int b43_probe(struct ssb_device *dev, const struct ssb_device_id *id) | |||
4989 | if (err) | 4996 | if (err) |
4990 | goto err_one_core_detach; | 4997 | goto err_one_core_detach; |
4991 | b43_leds_register(wl->current_dev); | 4998 | b43_leds_register(wl->current_dev); |
4992 | b43_rng_init(wl); | ||
4993 | } | 4999 | } |
4994 | 5000 | ||
4995 | out: | 5001 | out: |
@@ -5025,7 +5031,6 @@ static void b43_remove(struct ssb_device *dev) | |||
5025 | b43_one_core_detach(dev); | 5031 | b43_one_core_detach(dev); |
5026 | 5032 | ||
5027 | if (list_empty(&wl->devlist)) { | 5033 | if (list_empty(&wl->devlist)) { |
5028 | b43_rng_exit(wl); | ||
5029 | b43_leds_unregister(wl); | 5034 | b43_leds_unregister(wl); |
5030 | /* Last core on the chip unregistered. | 5035 | /* Last core on the chip unregistered. |
5031 | * We can destroy common struct b43_wl. | 5036 | * We can destroy common struct b43_wl. |