Re: [PATCH] Input: marix-keymap - automatically allocate memory for keymap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Alban,

On Wed, Nov 14, 2012 at 10:40:59AM +0100, Alban Bedel wrote:
> On Thu, 8 Nov 2012 08:45:21 -0800
> Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx> wrote:
> 
> > +	if (!keymap) {
> > +		keymap = devm_kzalloc(input_dev->dev.parent,
> > +				      max_keys * sizeof(*keymap),
> > +				      GFP_KERNEL);
> 
> In my tree GFP_KERNEL isn't defined at that point. Is an include
> missing in this patch or is my tree (3.6+some next cherry picks)
> missing a commit?

No, I apparetnly had an older tree when I created a patch, i have since
added include/linux/gfp.h

> 
> > +		if (!keymap) {
> > +			dev_err(input_dev->dev.parent,
> > +				"Unable to allocate memory for keymap");
> > +			return -ENOMEM;
> > +		}
> > +	}
> > +
> >  	input_dev->keycode = keymap;
> >  	input_dev->keycodesize = sizeof(*keymap);
> > -	input_dev->keycodemax = rows << row_shift;
> > +	input_dev->keycodemax = max_keys;
> >  
> >  	__set_bit(EV_KEY, input_dev->evbit);
> >  
> 
> Otherwise that look good to me.

Great, I am putting you down as reviewed-by then.

Thanks.

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


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux