[PATCH 47/48] drm: omapdrm: dss: Store the debugfs root directory in struct dss_device

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue Oct 17 22:34:58 UTC 2017


Hi Sebastian,

On Wednesday, 18 October 2017 01:16:53 EEST Sebastian Reichel wrote:
> Hi,
> 
> On Fri, Oct 13, 2017 at 05:59:43PM +0300, Laurent Pinchart wrote:
> > As part of an effort to remove the usage of global variables in the
> > driver, store the debugfs root directory in the dss_device structure
> > instead of a global variable.
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> > ---
> > 
> >  drivers/gpu/drm/omapdrm/dss/dispc.c |  2 +-
> >  drivers/gpu/drm/omapdrm/dss/dsi.c   |  8 ++++----
> >  drivers/gpu/drm/omapdrm/dss/dss.c   | 39 +++++++++++++++++---------------
> >  drivers/gpu/drm/omapdrm/dss/dss.h   |  9 ++++++---
> >  drivers/gpu/drm/omapdrm/dss/hdmi4.c |  3 ++-
> >  drivers/gpu/drm/omapdrm/dss/hdmi5.c |  3 ++-
> >  drivers/gpu/drm/omapdrm/dss/venc.c  |  3 ++-
> >  7 files changed, 37 insertions(+), 30 deletions(-)

[snip]

> > diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c
> > b/drivers/gpu/drm/omapdrm/dss/dss.c index 5d927dfe0a7f..f4e15850cc9d
> > 100644
> > --- a/drivers/gpu/drm/omapdrm/dss/dss.c
> > +++ b/drivers/gpu/drm/omapdrm/dss/dss.c
> > @@ -906,25 +906,23 @@ static int dss_debug_dump_clocks(struct seq_file *s,
> > void *p)
> >  	return 0;
> >  }
> > 
> > -static struct dentry *dss_debugfs_dir;
> > -
> >  static int dss_initialize_debugfs(struct dss_device *dss)
> >  {
> > -	dss_debugfs_dir = debugfs_create_dir("omapdss", NULL);
> > -	if (IS_ERR(dss_debugfs_dir)) {
> > -		int err = PTR_ERR(dss_debugfs_dir);
> > +	static struct dentry *dir;
> 
> static?

Oops. Will fix in v2. Thanks for catching it.

> Otherwise:
> 
> Reviewed-by: Sebastian Reichel <sebastian.reichel at collabora.co.uk>
> 
> -- Sebastian
> 
> > -		dss_debugfs_dir = NULL;
> > -		return err;
> > -	}
> > +	dir = debugfs_create_dir("omapdss", NULL);
> > +	if (IS_ERR(dir))
> > +		return PTR_ERR(dir);
> > +
> > +	dss->debugfs.root = dir;
> >  	return 0;
> >  }

[snip]

-- 
Regards,

Laurent Pinchart



More information about the dri-devel mailing list