Re: [Dri-devel][PATCH] sysfs simple class support for DRI char device

From: Greg KH
Date: Thu Mar 11 2004 - 16:03:30 EST


On Fri, Mar 05, 2004 at 12:14:15PM -0800, Leann Ogasawara wrote:
> Hi All,
>
> Patch adds sysfs simple class support for DRI character device (Major
> 226). Also, adds some error checking. Feedback appreciated. Thanks,

Looks good, but...

>
> DRM_DEBUG("\n");
> - if (register_chrdev(DRM_MAJOR, "drm", &DRM(stub_fops)))
> + ret1 = register_chrdev(DRM_MAJOR, "drm", &DRM(stub_fops));
> + if (!ret1) {
> + drm_class = class_simple_create(THIS_MODULE, "drm");
> + if (IS_ERR(drm_class)) {
> + printk (KERN_ERR "Error creating drm class.\n");
> + unregister_chrdev(DRM_MAJOR, "drm");
> + return PTR_ERR(drm_class);
> + }
> + }
> + else if (ret1 == -EBUSY)
> i = (struct drm_stub_info *)inter_module_get("drm");
> + else
> + return -1;

If ret1 == -EBUSY then we never create the "drm" class_simple structure,
right? That's not good.

Care to fix this up and send a new patch?

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/