virtio-rng: fixes for device registration/unregistration
authorSasha Levin <sasha.levin@oracle.com>
Fri, 16 May 2014 02:12:43 +0000 (11:42 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Sun, 18 May 2014 23:56:40 +0000 (09:26 +0930)
commita17597d3b418ca5a394d14724ccfc295cb3186c8
treea2421dacd4bef70854f146bdaf01eb6305160338
parente5d23a8cc38c555f9f3a40dcc5d14030105df9a8
virtio-rng: fixes for device registration/unregistration

There are several fixes in this patch (mostly because it's hard
splitting them up):

 - Revert the name field in struct hwrng back to 'const'. Also, don't
do an extra kmalloc for the name - just wasteful.
 - Deal with allocation failures properly.
 - Use IDA to allocate device number instead of brute forcing one.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/char/hw_random/virtio-rng.c
include/linux/hw_random.h