lkml.org 
[lkml]   [2012]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/2] gpio: do not call __gpio_xxx under !CONFIG_GPIOLIB
From
On Wed, Oct 31, 2012 at 8:00 AM, Yuanhan Liu
<yuanhan.liu@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


\
 
 \ /
  Last update: 2012-11-04 19:21    [W:0.044 / U:0.968 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site