Re: two patches - request for comments

From: Jeff Garzik
Date: Tue Jun 01 2004 - 16:27:47 EST


Andrew Zabolotny wrote:
No. class_find_device was written for lcd_find_device() and
backlight_find_device() (framebuffer devices use them). On the other hand,
the driver that registers the backlight device doesn't have a pointer to the
class device (well, the lcd_register_device could return it). Since the
lcd/backlight names are unique anyway, I don't see any problems with that, and
moreover, it is *registered* by giving it a name, why it should be
unregistered in a different way?


Typical Linux usage to an item being registered is

ptr = alloc_foo()
register_foo(ptr)
unregister_foo(ptr)
free_foo()

It is quite unusual to unregister based on name. Pointers are far more likely to be unique, and the programmer is far less likely to screw up the unregister operation.

Jeff


-
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/