RE: [PATCH 3/3] udmabuf: Use module_misc_device() to register this device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Acked-by: Vivek Kasireddy <vivek.kasireddy@xxxxxxxxx>

> 
> 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@xxxxxx>
> ---
>  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@xxxxxxxxxx>");
> --
> 2.39.2





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux