From: Andrew Davis <afd@ti.com>
To: "Gerd Hoffmann" <kraxel@redhat.com>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Christian König" <christian.koenig@amd.com>,
"Paul Cercueil" <paul@crapouillou.net>,
"Vivek Kasireddy" <vivek.kasireddy@intel.com>,
"Daniel Vetter" <daniel@ffwll.ch>
Cc: <dri-devel@lists.freedesktop.org>, <linux-media@vger.kernel.org>,
<linaro-mm-sig@lists.linaro.org>, <linux-kernel@vger.kernel.org>,
Andrew Davis <afd@ti.com>
Subject: [PATCH v2 3/3] udmabuf: Use module_misc_device() to register this device
Date: Thu, 14 Aug 2025 11:10:49 -0500 [thread overview]
Message-ID: <20250814161049.678672-4-afd@ti.com> (raw)
In-Reply-To: <20250814161049.678672-1-afd@ti.com>
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@ti.com>
Acked-by: Vivek Kasireddy <vivek.kasireddy@intel.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@redhat.com>");
+MODULE_DESCRIPTION("Userspace memfd to DMA-BUF misc Driver");
+MODULE_LICENSE("GPL");
--
2.39.2
next prev parent reply other threads:[~2025-08-14 16:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-14 16:10 [PATCH v2 0/3] udmabuf: Sync to attached devices Andrew Davis
2025-08-14 16:10 ` [PATCH v2 1/3] udmabuf: Keep track current device mappings Andrew Davis
2025-08-14 16:10 ` [PATCH v2 2/3] udmabuf: Sync buffer mappings for attached devices Andrew Davis
2025-08-14 16:10 ` Andrew Davis [this message]
2025-08-15 9:41 ` [PATCH v2 0/3] udmabuf: Sync to " Christian König
2025-08-15 19:40 ` Andrew Davis
2025-08-18 10:58 ` Christian König
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250814161049.678672-4-afd@ti.com \
--to=afd@ti.com \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=kraxel@redhat.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=paul@crapouillou.net \
--cc=sumit.semwal@linaro.org \
--cc=vivek.kasireddy@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox