--- zzzz-none-000/linux-2.6.19.2/drivers/char/drm/drm_sysfs.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5504/linux-2.6.19.2/drivers/char/drm/drm_sysfs.c 2007-01-11 07:38:19.000000000 +0000 @@ -42,24 +42,13 @@ struct class *drm_sysfs_create(struct module *owner, char *name) { struct class *class; - int err; class = class_create(owner, name); - if (!class) { - err = -ENOMEM; - goto err_out; - } - - err = class_create_file(class, &class_attr_version); - if (err) - goto err_out_class; + if (!class) + return class; + class_create_file(class, &class_attr_version); return class; - -err_out_class: - class_destroy(class); -err_out: - return ERR_PTR(err); } /** @@ -107,36 +96,20 @@ struct class_device *drm_sysfs_device_add(struct class *cs, drm_head_t *head) { struct class_device *class_dev; - int i, j, err; + int i; class_dev = class_device_create(cs, NULL, MKDEV(DRM_MAJOR, head->minor), &(head->dev->pdev)->dev, "card%d", head->minor); - if (!class_dev) { - err = -ENOMEM; - goto err_out; - } + if (!class_dev) + return NULL; class_set_devdata(class_dev, head); - for (i = 0; i < ARRAY_SIZE(class_device_attrs); i++) { - err = class_device_create_file(class_dev, - &class_device_attrs[i]); - if (err) - goto err_out_files; - } - + for (i = 0; i < ARRAY_SIZE(class_device_attrs); i++) + class_device_create_file(class_dev, &class_device_attrs[i]); return class_dev; - -err_out_files: - if (i > 0) - for (j = 0; j < i; j++) - class_device_remove_file(class_dev, - &class_device_attrs[i]); - class_device_unregister(class_dev); -err_out: - return ERR_PTR(err); } /**