[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250814161049.678672-4-afd@ti.com>
Date: Thu, 14 Aug 2025 11:10:49 -0500
From: Andrew Davis <afd@...com>
To: Gerd Hoffmann <kraxel@...hat.com>, Sumit Semwal <sumit.semwal@...aro.org>,
Christian König <christian.koenig@....com>,
Paul Cercueil
<paul@...pouillou.net>,
Vivek Kasireddy <vivek.kasireddy@...el.com>,
Daniel
Vetter <daniel@...ll.ch>
CC: <dri-devel@...ts.freedesktop.org>, <linux-media@...r.kernel.org>,
<linaro-mm-sig@...ts.linaro.org>, <linux-kernel@...r.kernel.org>,
Andrew
Davis <afd@...com>
Subject: [PATCH v2 3/3] udmabuf: Use module_misc_device() to register this device
Now that we do not need to call dma_coerce_mask_and_coherent() on our
miscdevice device, use the module_misc_device() helper for registering
and module init/exit.
While here, add module description and license, modules built with W=1
warn if built without these.
Signed-off-by: Andrew Davis <afd@...com>
Acked-by: Vivek Kasireddy <vivek.kasireddy@...el.com>
---
drivers/dma-buf/udmabuf.c | 24 +++---------------------
1 file changed, 3 insertions(+), 21 deletions(-)
diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c
index 8d71c3d72eb5e..d888e4d667c67 100644
--- a/drivers/dma-buf/udmabuf.c
+++ b/drivers/dma-buf/udmabuf.c
@@ -566,26 +566,8 @@ static struct miscdevice udmabuf_misc = {
.name = "udmabuf",
.fops = &udmabuf_fops,
};
-
-static int __init udmabuf_dev_init(void)
-{
- int ret;
-
- ret = misc_register(&udmabuf_misc);
- if (ret < 0) {
- pr_err("Could not initialize udmabuf device\n");
- return ret;
- }
-
- return 0;
-}
-
-static void __exit udmabuf_dev_exit(void)
-{
- misc_deregister(&udmabuf_misc);
-}
-
-module_init(udmabuf_dev_init)
-module_exit(udmabuf_dev_exit)
+module_misc_device(udmabuf_misc);
MODULE_AUTHOR("Gerd Hoffmann <kraxel@...hat.com>");
+MODULE_DESCRIPTION("Userspace memfd to DMA-BUF misc Driver");
+MODULE_LICENSE("GPL");
--
2.39.2
Powered by blists - more mailing lists