b43: Do not "select" HW_RANDOM
Auto-depend on HW_RANDOM, rather than "select"ing it. This way the user has the choice to enable or disable HWRNG support. Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
a57e2e84b6
commit
616de35da9
@ -2980,6 +2980,7 @@ static void b43_security_init(struct b43_wldev *dev)
|
||||
b43_clear_keys(dev);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_B43_HWRNG
|
||||
static int b43_rng_read(struct hwrng *rng, u32 *data)
|
||||
{
|
||||
struct b43_wl *wl = (struct b43_wl *)rng->priv;
|
||||
@ -2995,17 +2996,21 @@ static int b43_rng_read(struct hwrng *rng, u32 *data)
|
||||
|
||||
return (sizeof(u16));
|
||||
}
|
||||
#endif /* CONFIG_B43_HWRNG */
|
||||
|
||||
static void b43_rng_exit(struct b43_wl *wl)
|
||||
{
|
||||
#ifdef CONFIG_B43_HWRNG
|
||||
if (wl->rng_initialized)
|
||||
hwrng_unregister(&wl->rng);
|
||||
#endif /* CONFIG_B43_HWRNG */
|
||||
}
|
||||
|
||||
static int b43_rng_init(struct b43_wl *wl)
|
||||
{
|
||||
int err;
|
||||
int err = 0;
|
||||
|
||||
#ifdef CONFIG_B43_HWRNG
|
||||
snprintf(wl->rng_name, ARRAY_SIZE(wl->rng_name),
|
||||
"%s_%s", KBUILD_MODNAME, wiphy_name(wl->hw->wiphy));
|
||||
wl->rng.name = wl->rng_name;
|
||||
@ -3018,6 +3023,7 @@ static int b43_rng_init(struct b43_wl *wl)
|
||||
b43err(wl, "Failed to register the random "
|
||||
"number generator (%d)\n", err);
|
||||
}
|
||||
#endif /* CONFIG_B43_HWRNG */
|
||||
|
||||
return err;
|
||||
}
|
||||
|
Reference in New Issue
Block a user