Re: [PATCH] gpiolib: check if gpio_desc pointer is error or NULL

2014-03-19 Thread Alexandre Courbot
On Wed, Mar 19, 2014 at 5:33 PM, Ben Dooks wrote: > On 19/03/14 02:48, Alexandre Courbot wrote: >> >> On Tue, Mar 18, 2014 at 7:41 PM, Ben Dooks >> wrote: >>> >>> Some of the gpiod_ calls take a pointer to a gpio_desc as their >>> argument but only check to see if it is NULL to validate the >>> i

Re: [PATCH] gpiolib: check if gpio_desc pointer is error or NULL

2014-03-19 Thread Ben Dooks
On 19/03/14 02:48, Alexandre Courbot wrote: On Tue, Mar 18, 2014 at 7:41 PM, Ben Dooks wrote: Some of the gpiod_ calls take a pointer to a gpio_desc as their argument but only check to see if it is NULL to validate the input. Calls such as devm_gpiod_get() return an error-pointer if they fail,

Re: [PATCH] gpiolib: check if gpio_desc pointer is error or NULL

2014-03-18 Thread Alexandre Courbot
On Tue, Mar 18, 2014 at 7:41 PM, Ben Dooks wrote: > Some of the gpiod_ calls take a pointer to a gpio_desc as their > argument but only check to see if it is NULL to validate the > input. > > Calls such as devm_gpiod_get() return an error-pointer if they > fail, so doing the following will not wor

[PATCH] gpiolib: check if gpio_desc pointer is error or NULL

2014-03-18 Thread Ben Dooks
Some of the gpiod_ calls take a pointer to a gpio_desc as their argument but only check to see if it is NULL to validate the input. Calls such as devm_gpiod_get() return an error-pointer if they fail, so doing the following will not work: gpio = devm_gpiod_get(...); gpiod_directio