Re: Backlight and LCD module patches [1]

From: Andrew Zabolotny
Date: Thu Jun 17 2004 - 16:56:17 EST


On Thu, 17 Jun 2004 12:47:39 -0700
Greg KH <greg@xxxxxxxxx> wrote:

> So no, I'm not going to accept this, you need to change your lcd code to
> pass around pointers to the proper structures, instead of trying to rely
> on the name of a device. Because of this, I'm not going to apply your
> second patch.
I think you missed something. It doesn't rely on the name of the device while
registering/unregistering, I've changed this, look:

extern int lcd_device_register(const char *name, void *devdata,
struct lcd_properties *lp,
struct lcd_device **alloc_ld);
extern void lcd_device_unregister(struct lcd_device *ld);

So the `register` function returns a pointer (fourth argument) to the created
and registered device, and in module_unload it calls something like
lcd_device_unregister (my_lcd_device). The name is passed during registration
because it has to be copied to the allocated struct device (and so that
find_device_by_name() can find the device by name).

Now this:

extern struct lcd_device *lcd_device_find(const char *name);

It needs a char* argument because there's no other easy way to find the
correspondence between framebuffer devices and lcd/backlight devices
corresponding to that framebuffer device. So the conventionality is that the
lcd/backlight devices bear the same name as the framebuffer they correspond
to, so the framebuffer device can easily find them.

Same reasons apply to backlight devices, they are quite similar.

--
Greetings,
Andrew
-
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/