Skip to content

Commit

Permalink
Driver Core: drm: add nodename for drm devices
Browse files Browse the repository at this point in the history
This adds support to the drm core to report the proper device name to
userspace for the drm devices.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Jan Blunck <jblunck@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Kay Sievers authored and Greg Kroah-Hartman committed Jun 16, 2009
1 parent 6fd4693 commit 02200d0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/gpu/drm/drm_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ static ssize_t version_show(struct class *dev, char *buf)
CORE_MINOR, CORE_PATCHLEVEL, CORE_DATE);
}

static char *drm_nodename(struct device *dev)
{
return kasprintf(GFP_KERNEL, "dri/%s", dev_name(dev));
}

static CLASS_ATTR(version, S_IRUGO, version_show, NULL);

/**
Expand Down Expand Up @@ -101,6 +106,8 @@ struct class *drm_sysfs_create(struct module *owner, char *name)
if (err)
goto err_out_class;

class->nodename = drm_nodename;

return class;

err_out_class:
Expand Down

0 comments on commit 02200d0

Please sign in to comment.