diff mbox series

hwrng: core - remove (un)register_miscdev()

Message ID 20240706144205.2301865-1-masahiroy@kernel.org (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series hwrng: core - remove (un)register_miscdev() | expand

Commit Message

Masahiro Yamada July 6, 2024, 2:41 p.m. UTC
These functions are redundant after commit 0daa7a0afd0f ("hwrng: Avoid
manual device_create_file() calls").

Let's call misc_(de)register() directly.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 drivers/char/hw_random/core.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

Comments

Herbert Xu July 12, 2024, 11:57 p.m. UTC | #1
On Sat, Jul 06, 2024 at 11:41:24PM +0900, Masahiro Yamada wrote:
> These functions are redundant after commit 0daa7a0afd0f ("hwrng: Avoid
> manual device_create_file() calls").
> 
> Let's call misc_(de)register() directly.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
>  drivers/char/hw_random/core.c | 14 ++------------
>  1 file changed, 2 insertions(+), 12 deletions(-)

Patch applied.  Thanks.
diff mbox series

Patch

diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
index 4084df65c9fa..29a663db6909 100644
--- a/drivers/char/hw_random/core.c
+++ b/drivers/char/hw_random/core.c
@@ -470,16 +470,6 @@  static struct attribute *rng_dev_attrs[] = {
 
 ATTRIBUTE_GROUPS(rng_dev);
 
-static void __exit unregister_miscdev(void)
-{
-	misc_deregister(&rng_miscdev);
-}
-
-static int __init register_miscdev(void)
-{
-	return misc_register(&rng_miscdev);
-}
-
 static int hwrng_fillfn(void *unused)
 {
 	size_t entropy, entropy_credit = 0; /* in 1/1024 of a bit */
@@ -668,7 +658,7 @@  static int __init hwrng_modinit(void)
 		return -ENOMEM;
 	}
 
-	ret = register_miscdev();
+	ret = misc_register(&rng_miscdev);
 	if (ret) {
 		kfree(rng_fillbuf);
 		kfree(rng_buffer);
@@ -685,7 +675,7 @@  static void __exit hwrng_modexit(void)
 	kfree(rng_fillbuf);
 	mutex_unlock(&rng_mutex);
 
-	unregister_miscdev();
+	misc_deregister(&rng_miscdev);
 }
 
 fs_initcall(hwrng_modinit); /* depends on misc_register() */