Driver Core: drm: add nodename for drm devices
authorKay Sievers <kay.sievers@vrfy.org>
Thu, 30 Apr 2009 13:23:42 +0000 (15:23 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 16 Jun 2009 04:30:26 +0000 (21:30 -0700)
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>
drivers/gpu/drm/drm_sysfs.c

index 9987ab8808356d13b01c2540c085181e4f7db791..85ec31b3ff00a09f1d18b0a9b66cd31b68d8ba21 100644 (file)
@@ -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);
 
 /**
@@ -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: