Re: [PATCH RFC 02/15 v5] gpio: Add sysfs support to block GPIO API

2012-10-22 Thread Roland Stigge
On 10/22/2012 10:55 AM, Linus Walleij wrote: > On Fri, Oct 19, 2012 at 1:51 PM, Roland Stigge wrote: >> So what do you think about my just proposed idea of always having the >> "value" argument present, but only useable when "exported" is "1"? Now >> only talking about the block gpios, but later

Re: [PATCH RFC 02/15 v5] gpio: Add sysfs support to block GPIO API

2012-10-22 Thread Linus Walleij
On Fri, Oct 19, 2012 at 1:51 PM, Roland Stigge wrote: > [Me] >> The block GPIO stuff is just following that design pattern. > > So what do you think about my just proposed idea of always having the > "value" argument present, but only useable when "exported" is "1"? Now > only talking about the

Re: [PATCH RFC 02/15 v5] gpio: Add sysfs support to block GPIO API

2012-10-22 Thread Linus Walleij
On Fri, Oct 19, 2012 at 8:02 PM, Greg KH wrote: > We used to have problems with attributes removing/adding devices or > attributes from their callbacks, but that has been fixed up now, and the > fact that the other gpio code works this way is good enough precedence > to keep me from objecting to

Re: [PATCH RFC 02/15 v5] gpio: Add sysfs support to block GPIO API

2012-10-22 Thread Linus Walleij
On Fri, Oct 19, 2012 at 8:02 PM, Greg KH gre...@linuxfoundation.org wrote: We used to have problems with attributes removing/adding devices or attributes from their callbacks, but that has been fixed up now, and the fact that the other gpio code works this way is good enough precedence to

Re: [PATCH RFC 02/15 v5] gpio: Add sysfs support to block GPIO API

2012-10-22 Thread Linus Walleij
On Fri, Oct 19, 2012 at 1:51 PM, Roland Stigge sti...@antcom.de wrote: [Me] The block GPIO stuff is just following that design pattern. So what do you think about my just proposed idea of always having the value argument present, but only useable when exported is 1? Now only talking about

Re: [PATCH RFC 02/15 v5] gpio: Add sysfs support to block GPIO API

2012-10-22 Thread Roland Stigge
On 10/22/2012 10:55 AM, Linus Walleij wrote: On Fri, Oct 19, 2012 at 1:51 PM, Roland Stigge sti...@antcom.de wrote: So what do you think about my just proposed idea of always having the value argument present, but only useable when exported is 1? Now only talking about the block gpios, but

Re: [PATCH RFC 02/15 v5] gpio: Add sysfs support to block GPIO API

2012-10-19 Thread Greg KH
On Thu, Oct 18, 2012 at 12:07:39PM +0200, Roland Stigge wrote: > On 10/17/2012 09:05 PM, Greg KH wrote: > >> +static int gpio_block_value_unexport(struct gpio_block *block) > >> +{ > >> + struct device *dev; > >> + int i; > >> + > >> + dev = class_find_device(_block_class, NULL,

Re: [PATCH RFC 02/15 v5] gpio: Add sysfs support to block GPIO API

2012-10-19 Thread Roland Stigge
On 10/19/2012 12:35 PM, Linus Walleij wrote: > On Thu, Oct 18, 2012 at 12:07 PM, Roland Stigge wrote: >> On 10/17/2012 09:05 PM, Greg KH wrote: +if (value != exported) { +if (value) +status = gpio_block_value_export(block); +

Re: [PATCH RFC 02/15 v5] gpio: Add sysfs support to block GPIO API

2012-10-19 Thread Linus Walleij
On Thu, Oct 18, 2012 at 12:07 PM, Roland Stigge wrote: > On 10/17/2012 09:05 PM, Greg KH wrote: >>> >>> +if (value != exported) { >>> +if (value) >>> +status = gpio_block_value_export(block); >>> +else >>> +status =

Re: [PATCH RFC 02/15 v5] gpio: Add sysfs support to block GPIO API

2012-10-19 Thread Linus Walleij
On Thu, Oct 18, 2012 at 12:07 PM, Roland Stigge sti...@antcom.de wrote: On 10/17/2012 09:05 PM, Greg KH wrote: +if (value != exported) { +if (value) +status = gpio_block_value_export(block); +else +status =

Re: [PATCH RFC 02/15 v5] gpio: Add sysfs support to block GPIO API

2012-10-19 Thread Roland Stigge
On 10/19/2012 12:35 PM, Linus Walleij wrote: On Thu, Oct 18, 2012 at 12:07 PM, Roland Stigge sti...@antcom.de wrote: On 10/17/2012 09:05 PM, Greg KH wrote: +if (value != exported) { +if (value) +status = gpio_block_value_export(block); +else

Re: [PATCH RFC 02/15 v5] gpio: Add sysfs support to block GPIO API

2012-10-19 Thread Greg KH
On Thu, Oct 18, 2012 at 12:07:39PM +0200, Roland Stigge wrote: On 10/17/2012 09:05 PM, Greg KH wrote: +static int gpio_block_value_unexport(struct gpio_block *block) +{ + struct device *dev; + int i; + + dev = class_find_device(gpio_block_class, NULL, block,

Re: [PATCH RFC 02/15 v5] gpio: Add sysfs support to block GPIO API

2012-10-18 Thread Roland Stigge
On 10/17/2012 09:05 PM, Greg KH wrote: >> +static int gpio_block_value_unexport(struct gpio_block *block) >> +{ >> +struct device *dev; >> +int i; >> + >> +dev = class_find_device(_block_class, NULL, block, match_export); >> +if (!dev) >> +return -ENODEV;

Re: [PATCH RFC 02/15 v5] gpio: Add sysfs support to block GPIO API

2012-10-18 Thread Roland Stigge
On 10/17/2012 09:05 PM, Greg KH wrote: +static int gpio_block_value_unexport(struct gpio_block *block) +{ +struct device *dev; +int i; + +dev = class_find_device(gpio_block_class, NULL, block, match_export); +if (!dev) +return -ENODEV; + +for

Re: [PATCH RFC 02/15 v5] gpio: Add sysfs support to block GPIO API

2012-10-17 Thread Greg KH
On Wed, Oct 17, 2012 at 02:31:34PM +0200, Roland Stigge wrote: > This patch adds sysfs support to the block GPIO API. > > Signed-off-by: Roland Stigge > > --- > Documentation/ABI/testing/sysfs-gpio |6 > drivers/gpio/gpiolib.c | 214 > +++ >

[PATCH RFC 02/15 v5] gpio: Add sysfs support to block GPIO API

2012-10-17 Thread Roland Stigge
This patch adds sysfs support to the block GPIO API. Signed-off-by: Roland Stigge --- Documentation/ABI/testing/sysfs-gpio |6 drivers/gpio/gpiolib.c | 214 +++ include/asm-generic/gpio.h | 11 + include/linux/gpio.h

[PATCH RFC 02/15 v5] gpio: Add sysfs support to block GPIO API

2012-10-17 Thread Roland Stigge
This patch adds sysfs support to the block GPIO API. Signed-off-by: Roland Stigge sti...@antcom.de --- Documentation/ABI/testing/sysfs-gpio |6 drivers/gpio/gpiolib.c | 214 +++ include/asm-generic/gpio.h | 11 +

Re: [PATCH RFC 02/15 v5] gpio: Add sysfs support to block GPIO API

2012-10-17 Thread Greg KH
On Wed, Oct 17, 2012 at 02:31:34PM +0200, Roland Stigge wrote: This patch adds sysfs support to the block GPIO API. Signed-off-by: Roland Stigge sti...@antcom.de --- Documentation/ABI/testing/sysfs-gpio |6 drivers/gpio/gpiolib.c | 214