[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <IA0PR11MB71855122BCF73421B7B531AEF87B2@IA0PR11MB7185.namprd11.prod.outlook.com>
Date: Wed, 24 Jan 2024 22:37:36 +0000
From: "Kasireddy, Vivek" <vivek.kasireddy@...el.com>
To: Andrew Davis <afd@...com>, Gerd Hoffmann <kraxel@...hat.com>, Sumit Semwal
<sumit.semwal@...aro.org>, Christian König
<christian.koenig@....com>, Paul Cercueil <paul@...pouillou.net>
CC: "linaro-mm-sig@...ts.linaro.org" <linaro-mm-sig@...ts.linaro.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"linux-media@...r.kernel.org" <linux-media@...r.kernel.org>
Subject: RE: [PATCH 3/3] udmabuf: Use module_misc_device() to register this
device
Acked-by: Vivek Kasireddy <vivek.kasireddy@...el.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.
>
> Signed-off-by: Andrew Davis <afd@...com>
> ---
> drivers/dma-buf/udmabuf.c | 30 +-----------------------------
> 1 file changed, 1 insertion(+), 29 deletions(-)
>
> diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c index
> ab6764322523c..3028ac3fd9f6a 100644
> --- a/drivers/dma-buf/udmabuf.c
> +++ b/drivers/dma-buf/udmabuf.c
> @@ -392,34 +392,6 @@ 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;
> - }
> -
> - ret = dma_coerce_mask_and_coherent(udmabuf_misc.this_device,
> - DMA_BIT_MASK(64));
> - if (ret < 0) {
> - pr_err("Could not setup DMA mask for udmabuf device\n");
> - misc_deregister(&udmabuf_misc);
> - 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>");
> --
> 2.39.2
Powered by blists - more mailing lists