Dmitry Torokhov wrote:
On Wed, Sep 23, 2009 at 11:25:59AM -0600, Miguel Aguilar wrote:
Please kopy keymap into the davinci_kp stucture and use it so that
platform data is never changed and can be declared const.
Do you mean something like this?
struct davinci_kp {
...
const int *keymap;
...
};
More like:
struct davinci_kp {
...
unsgned char keymap[];
...
};
[MA] Ok.
[MA] Why usigned char with no pointer and not u32 as most of the keypad
driver as defined?
Sorry, meant to say "unsigned short keymap[...]", we not going to have
more than 64K keycodes. You need to fill the array dimension, if the
size is not known before hand (and if upper bound is too jigh to always
allocate max) then you'll have to allocate it separately. Hm, well, if
you make it the last element of the davinci_kp structure you can alwqays
allocate the needed amount of memory, like this:
struct davinci_kp {
...
...
unsigned short keymap[];
};
...
kp = kzalloc(sizeof(struct davinci_kp) +
sizeof(unsigned short) * pdata->keymap_size,
GFP_KERNEL);
Why do I need to use keymap[]; instead of *keymap? If I use keypad[] how is the
proper way to assign the platform keymap to the private keymap of the driver?
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html