drm/radeon: Don't unreserve twice on failure to validate.
[safe/jmp/linux-2.6] / drivers / gpu / drm / drm_sysfs.c
index 182bdf9..85ec31b 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:
@@ -317,6 +324,7 @@ static struct device_attribute connector_attrs_opt1[] = {
 
 static struct bin_attribute edid_attr = {
        .attr.name = "edid",
+       .attr.mode = 0444,
        .size = 128,
        .read = edid_show,
 };