Re: [PATCH 2/2] gpio: do not call __gpio_xxx under !CONFIG_GPIOLIB

2012-11-05 Thread Yuanhan Liu
On Sun, Nov 04, 2012 at 06:47:12PM +0100, Linus Walleij wrote:
> On Wed, Oct 31, 2012 at 8:00 AM, Yuanhan Liu
>  wrote:
> 
> > Those functions are availabe only when CONFIG_GPIOLIB is set. So, we
> > should not call them under !CONFIG_GPIOLIB block.
> >
> > This would fix following build errros:
> > include/asm-generic/gpio.h: In function 'gpio_get_value_cansleep':
> > include/asm-generic/gpio.h:220:2: error: implicit declaration of function 
> > '__gpio_get_value'
> > include/asm-generic/gpio.h: In function 'gpio_set_value_cansleep':
> > nclude/asm-generic/gpio.h:226:2: error: implicit declaration of function 
> > '__gpio_set_value'
> 
> OK...
> 
> >  static inline int gpio_get_value_cansleep(unsigned gpio)
> >  {
> > -   might_sleep();
Hi,

> 
> So why are you deleting this very useful might_sleep() runtime
> semantic check?

Yes, I should keep it. I did it because I saw the definition of
gpio_get_value at include/linux/gpio.h didn't call that function.

Will keep it in the next version together with the previous patch.
And sorry that it may take some time, as I'm occupied by other things :(

Thanks.

--yliu
> 
> > -   return __gpio_get_value(gpio);
> > +   WARN_ON(1);
> > +   return 0;
> >  }
> >
> >  static inline void gpio_set_value_cansleep(unsigned gpio, int value)
> >  {
> > -   might_sleep();
> > -   __gpio_set_value(gpio, value);
> > +   WARN_ON(1);
> >  }
> 
> Yours,
> Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] gpio: do not call __gpio_xxx under !CONFIG_GPIOLIB

2012-11-05 Thread Yuanhan Liu
On Sun, Nov 04, 2012 at 06:47:12PM +0100, Linus Walleij wrote:
 On Wed, Oct 31, 2012 at 8:00 AM, Yuanhan Liu
 yuanhan@linux.intel.com wrote:
 
  Those functions are availabe only when CONFIG_GPIOLIB is set. So, we
  should not call them under !CONFIG_GPIOLIB block.
 
  This would fix following build errros:
  include/asm-generic/gpio.h: In function 'gpio_get_value_cansleep':
  include/asm-generic/gpio.h:220:2: error: implicit declaration of function 
  '__gpio_get_value'
  include/asm-generic/gpio.h: In function 'gpio_set_value_cansleep':
  nclude/asm-generic/gpio.h:226:2: error: implicit declaration of function 
  '__gpio_set_value'
 
 OK...
 
   static inline int gpio_get_value_cansleep(unsigned gpio)
   {
  -   might_sleep();
Hi,

 
 So why are you deleting this very useful might_sleep() runtime
 semantic check?

Yes, I should keep it. I did it because I saw the definition of
gpio_get_value at include/linux/gpio.h didn't call that function.

Will keep it in the next version together with the previous patch.
And sorry that it may take some time, as I'm occupied by other things :(

Thanks.

--yliu
 
  -   return __gpio_get_value(gpio);
  +   WARN_ON(1);
  +   return 0;
   }
 
   static inline void gpio_set_value_cansleep(unsigned gpio, int value)
   {
  -   might_sleep();
  -   __gpio_set_value(gpio, value);
  +   WARN_ON(1);
   }
 
 Yours,
 Linus Walleij
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] gpio: do not call __gpio_xxx under !CONFIG_GPIOLIB

2012-11-04 Thread Linus Walleij
On Wed, Oct 31, 2012 at 8:00 AM, Yuanhan Liu
 wrote:

> Those functions are availabe only when CONFIG_GPIOLIB is set. So, we
> should not call them under !CONFIG_GPIOLIB block.
>
> This would fix following build errros:
> include/asm-generic/gpio.h: In function 'gpio_get_value_cansleep':
> include/asm-generic/gpio.h:220:2: error: implicit declaration of function 
> '__gpio_get_value'
> include/asm-generic/gpio.h: In function 'gpio_set_value_cansleep':
> nclude/asm-generic/gpio.h:226:2: error: implicit declaration of function 
> '__gpio_set_value'

OK...

>  static inline int gpio_get_value_cansleep(unsigned gpio)
>  {
> -   might_sleep();

So why are you deleting this very useful might_sleep() runtime
semantic check?

> -   return __gpio_get_value(gpio);
> +   WARN_ON(1);
> +   return 0;
>  }
>
>  static inline void gpio_set_value_cansleep(unsigned gpio, int value)
>  {
> -   might_sleep();
> -   __gpio_set_value(gpio, value);
> +   WARN_ON(1);
>  }

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] gpio: do not call __gpio_xxx under !CONFIG_GPIOLIB

2012-11-04 Thread Linus Walleij
On Wed, Oct 31, 2012 at 8:00 AM, Yuanhan Liu
yuanhan@linux.intel.com wrote:

 Those functions are availabe only when CONFIG_GPIOLIB is set. So, we
 should not call them under !CONFIG_GPIOLIB block.

 This would fix following build errros:
 include/asm-generic/gpio.h: In function 'gpio_get_value_cansleep':
 include/asm-generic/gpio.h:220:2: error: implicit declaration of function 
 '__gpio_get_value'
 include/asm-generic/gpio.h: In function 'gpio_set_value_cansleep':
 nclude/asm-generic/gpio.h:226:2: error: implicit declaration of function 
 '__gpio_set_value'

OK...

  static inline int gpio_get_value_cansleep(unsigned gpio)
  {
 -   might_sleep();

So why are you deleting this very useful might_sleep() runtime
semantic check?

 -   return __gpio_get_value(gpio);
 +   WARN_ON(1);
 +   return 0;
  }

  static inline void gpio_set_value_cansleep(unsigned gpio, int value)
  {
 -   might_sleep();
 -   __gpio_set_value(gpio, value);
 +   WARN_ON(1);
  }

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] gpio: do not call __gpio_xxx under !CONFIG_GPIOLIB

2012-10-31 Thread Yuanhan Liu
Those functions are availabe only when CONFIG_GPIOLIB is set. So, we
should not call them under !CONFIG_GPIOLIB block.

This would fix following build errros:
include/asm-generic/gpio.h: In function 'gpio_get_value_cansleep':
include/asm-generic/gpio.h:220:2: error: implicit declaration of function 
'__gpio_get_value'
include/asm-generic/gpio.h: In function 'gpio_set_value_cansleep':
nclude/asm-generic/gpio.h:226:2: error: implicit declaration of function 
'__gpio_set_value'

Cc: Grant Likely 
Cc: Linus Walleij 
Cc: Fengguang Wu 
Signed-off-by: Yuanhan Liu 
---
 include/asm-generic/gpio.h |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index a73272d..704bf5d 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -257,14 +257,13 @@ static inline int gpio_cansleep(unsigned gpio)
 
 static inline int gpio_get_value_cansleep(unsigned gpio)
 {
-   might_sleep();
-   return __gpio_get_value(gpio);
+   WARN_ON(1);
+   return 0;
 }
 
 static inline void gpio_set_value_cansleep(unsigned gpio, int value)
 {
-   might_sleep();
-   __gpio_set_value(gpio, value);
+   WARN_ON(1);
 }
 
 #endif /* !CONFIG_GPIOLIB */
-- 
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] gpio: do not call __gpio_xxx under !CONFIG_GPIOLIB

2012-10-31 Thread Yuanhan Liu
Those functions are availabe only when CONFIG_GPIOLIB is set. So, we
should not call them under !CONFIG_GPIOLIB block.

This would fix following build errros:
include/asm-generic/gpio.h: In function 'gpio_get_value_cansleep':
include/asm-generic/gpio.h:220:2: error: implicit declaration of function 
'__gpio_get_value'
include/asm-generic/gpio.h: In function 'gpio_set_value_cansleep':
nclude/asm-generic/gpio.h:226:2: error: implicit declaration of function 
'__gpio_set_value'

Cc: Grant Likely grant.lik...@secretlab.ca
Cc: Linus Walleij linus.wall...@linaro.org
Cc: Fengguang Wu fengguang...@intel.com
Signed-off-by: Yuanhan Liu yuanhan@linux.intel.com
---
 include/asm-generic/gpio.h |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index a73272d..704bf5d 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -257,14 +257,13 @@ static inline int gpio_cansleep(unsigned gpio)
 
 static inline int gpio_get_value_cansleep(unsigned gpio)
 {
-   might_sleep();
-   return __gpio_get_value(gpio);
+   WARN_ON(1);
+   return 0;
 }
 
 static inline void gpio_set_value_cansleep(unsigned gpio, int value)
 {
-   might_sleep();
-   __gpio_set_value(gpio, value);
+   WARN_ON(1);
 }
 
 #endif /* !CONFIG_GPIOLIB */
-- 
1.7.7.6

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/