Re: [RFC 2/3] drm: Register drmfs filesystem from drm init

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

 



On Thu, Dec 01, 2016 at 12:32:32PM +0530, swati.dhingra@xxxxxxxxx wrote:
> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> index 84fcfcb..ead360bd 100644
> --- a/drivers/gpu/drm/drm_drv.c
> +++ b/drivers/gpu/drm/drm_drv.c
> @@ -688,6 +688,14 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
>  {
>  	int ret;
>  
> +#ifdef CONFIG_DRMFS

Rule of thumb: avoid #ifdeffry in the body of the code, use headers to
hide conditional compilation.

> +	dev->driver->drmfs_root = drmfs_create_dir(dev->driver->name, NULL);
> +	if (IS_ERR(dev->driver->drmfs_root)) {
> +		DRM_ERROR("Failed to get drmfs root dentry\n");
> +		return PTR_ERR(dev->driver->drmfs_root);
> +	}

Considering use of drmfs is optional, should an error here prevent the
driver from loading?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux