From: Chen Gang <gang.chen@asianux.com>
To: linus.walleij@linaro.org
Cc: Arnd Bergmann <arnd@arndb.de>,
linux-gpio@vger.kernel.org,
Linux-Arch <linux-arch@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH] include/asm-generic/gpio.h: remove the call for __gpio_get_value() and __gpio_set_value() when GPIOLIB disabled
Date: Mon, 26 Aug 2013 18:08:23 +0800 [thread overview]
Message-ID: <521B2917.6040908@asianux.com> (raw)
When GPIOLIB disabled, __gpio_get_value() and __gpio_set_value() will
not implement, so need remove them, or compiling fails.
e.g. (allmodconfig for h8300)
CC arch/h8300/kernel/h8300_ksyms.o
In file included from arch/h8300/include/generated/asm/gpio.h:1:0,
from arch/h8300/kernel/h8300_ksyms.c:17:
include/asm-generic/gpio.h: In function 'gpio_get_value_cansleep':
include/asm-generic/gpio.h:270:2: error: implicit declaration of function '__gpio_get_value' [-Werror=implicit-function-declaration]
return __gpio_get_value(gpio);
^
For __gpio_get_value(), according to its implementation, it is enough
to use "return 0" instead of, and for __gpio_set_value(), just remove
directly.
Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
include/asm-generic/gpio.h | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index bde6469..10a2853 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -267,13 +267,12 @@ static inline int gpio_cansleep(unsigned gpio)
static inline int gpio_get_value_cansleep(unsigned gpio)
{
might_sleep();
- return __gpio_get_value(gpio);
+ return 0;
}
static inline void gpio_set_value_cansleep(unsigned gpio, int value)
{
might_sleep();
- __gpio_set_value(gpio, value);
}
#endif /* !CONFIG_GPIOLIB */
--
1.7.7.6
next reply other threads:[~2013-08-26 10:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-26 10:08 Chen Gang [this message]
2013-08-29 12:08 ` [PATCH] include/asm-generic/gpio.h: remove the call for __gpio_get_value() and __gpio_set_value() when GPIOLIB disabled Linus Walleij
2013-08-30 1:50 ` Chen Gang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=521B2917.6040908@asianux.com \
--to=gang.chen@asianux.com \
--cc=arnd@arndb.de \
--cc=linus.walleij@linaro.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox