Re: [PATCH 20/30] staging: nvec: Create nvec_event module for power button/lid switch

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

 



On Fri, Sep 23, 2011 at 06:38:12PM +0200, Julian Andres Klode wrote:
> +static int __devinit nvec_event_probe(struct platform_device *pdev)
> +{
> +	struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent);
> +	int err;
> +
> +	event_handler.nvec = nvec;
> +	event_handler.sleep = input_allocate_device();

The allocation can fail.

> +	event_handler.sleep->name = "NVEC sleep button";
> +	event_handler.sleep->phys = "NVEC";
> +	event_handler.sleep->evbit[0] = BIT_MASK(EV_KEY);
> +	set_bit(KEY_SLEEP, event_handler.sleep->keybit);
> +
> +	event_handler.power = input_allocate_device();

Same.

> +	event_handler.power->name = "NVEC power button";
> +	event_handler.power->phys = "NVEC";
> +	event_handler.power->evbit[0] = BIT_MASK(EV_KEY);
> +	set_bit(KEY_POWER, event_handler.power->keybit);
> +
> +	event_handler.lid = input_allocate_device();

Same.

> +	event_handler.lid->name = "NVEC lid switch button";
> +	event_handler.lid->phys = "NVEC";
> +	event_handler.lid->evbit[0] = BIT_MASK(EV_SW);
> +	set_bit(SW_LID, event_handler.lid->swbit);

regards,
dan carpenter
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux