[Intel-gfx] [PATCH] add debugfs init hooks

Eric Anholt eric at anholt.net
Wed Jan 14 20:32:00 CET 2009


On Sun, 2008-12-21 at 15:21 -0500, Ben Gamari wrote:
> ---
>  drivers/gpu/drm/drm_stub.c |   12 ++++++++++++
>  1 files changed, 12 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
> index 5697764..23f1bca 100644
> --- a/drivers/gpu/drm/drm_stub.c
> +++ b/drivers/gpu/drm/drm_stub.c
> @@ -50,6 +50,7 @@ struct idr drm_minors_idr;
>  
>  struct class *drm_class;
>  struct proc_dir_entry *drm_proc_root;
> +struct dentry *drm_debugfs_root;
>  
>  static int drm_minor_get_id(struct drm_device *dev, int type)
>  {
> @@ -314,6 +315,14 @@ static int drm_get_minor(struct drm_device *dev, struct drm_minor **minor, int t
>  	} else
>  		new_minor->proc_root = NULL;
>  
> +#if defined(CONFIG_DRM_DEBUGFS)
> +        ret = drm_debugfs_init(new_minor, minor_id, drm_debugfs_root);
> +        if (ret) {
> +                DRM_ERROR("DRM: Failed to initialize /debugfs/dri.\n");
> +                goto err_g2;
> +        }
> +#endif
> +
>  	ret = drm_sysfs_device_add(new_minor);
>  	if (ret) {
>  		printk(KERN_ERR
> @@ -449,6 +458,9 @@ int drm_put_minor(struct drm_minor **minor_p)
>  
>  	if (minor->type == DRM_MINOR_LEGACY)
>  		drm_proc_cleanup(minor, drm_proc_root);
> +#if defined(CONFIG_DRM_DEBUGFS)
> +        drm_debugfs_cleanup(minor);
> +#endif
>  	drm_sysfs_device_remove(minor);
>  
>  	idr_remove(&drm_minors_idr, minor->index);

This appears to depend on a later patch, and should be merged in with
that one.  Also, watch the whitespace -- the kernel uses 8-space tabs,
not 8 spaces.

-- 
Eric Anholt
eric at anholt.net                         eric.anholt at intel.com


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20090114/6831ba10/attachment.sig>


More information about the Intel-gfx mailing list