Re: [PATCH RESEND 1/2] input: gpio_keys_polled: Convert to devm-* API

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

 



On Tue, Apr 29, 2014 at 08:43:48AM +0400, Alexander Shiyan wrote:
> Mon, 28 Apr 2014 20:26:00 -0700 от Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>:
> > Hi Alexander,
> > 
> > On Sat, Apr 26, 2014 at 09:53:13AM +0400, Alexander Shiyan wrote:
> > > Replace existing resource handling in the driver with managed
> > > device resource, this ensures more consistent error values and
> > > simplifies error paths.
> > > kzalloc -> devm_kzalloc
> > > gpio_request_one -> devm_gpio_request_one
> > > 
> > 
> > If we are doing the conversion can we go all the Alexanderway (needs the
> > other 2 patches I just posted and CCed you)?
> > 
> > Thanks.
> > 
> > -- 
> > Dmitry
> > 
> > Input: gpio_keys_polled - convert to devm-* API
> > 
> > From: Alexander Shiyan <shc_work@xxxxxxx>
> > 
> > Replace existing resource handling in the driver with managed device
> > resources, this ensures more consistent error values and simplifies error
> > handling paths:
> > 
> > kzalloc -> devm_kzalloc
> > gpio_request_one -> devm_gpio_request_one
> > input_allocate_polled_device -> devm_input_allocate_polled_device
> > 
> > Signed-off-by: Alexander Shiyan <shc_work@xxxxxxx>
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
> > ---
> ...
> > @@ -162,8 +160,7 @@ static struct gpio_keys_platform_data *gpio_keys_polled_get_devtree_pdata(struct
> >  		if (of_property_read_u32(pp, "linux,code", &button->code)) {
> >  			dev_err(dev, "Button without keycode: 0x%x\n",
> >  				button->gpio);
> > -			error = -EINVAL;
> > -			goto err_free_pdata;
> > +			return ERR_PTR(-EINVAL);
> >  		}
> 
> We can even use return value from of_property_read_u32() on error.
> 
> All other looks OK.

Do you have hardware that uses gpio_keys_polled?

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