From patchwork Tue Nov 6 16:21:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 12696 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 2DFBF23EFB for ; Tue, 6 Nov 2012 16:21:21 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 97908A18D4C for ; Tue, 6 Nov 2012 16:21:20 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so807976iej.11 for ; Tue, 06 Nov 2012 08:21:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=lqcLM3R7xkD8e92XKHxo56J8aueZBtTvgZJE/TD3YlA=; b=pNCZOtDikYROfTteuH5S1YmdEW5m1wC9WUqMIYlC9d8yX8Cs5X0MSrFAnN9x25UGHP v0KrY4thAhQEiG5QvTPZT/ssYfz5W3ABrF2IMM/bFRUT7YMo1B19/GZAu6SO4zJn0X/9 K2NYP+imMJlMt5tsjeGIjEsea0dR86I6g5dPSjhfPiImFMAkBiUeeTX+p231RExkmC5w l8YCkh5v6SMWqGVPTLciximpJMZB8z700krKTqktJiqNBtQ/9rPFT397rmzdVkJfWjPb 2q71lQNgVfLqJxLvlry9k6cY8XV1MCrI2onqg+pean1Q30yCviBq3jWkJI0xHke6SD5F 49og== Received: by 10.50.161.169 with SMTP id xt9mr13338937igb.62.1352218880049; Tue, 06 Nov 2012 08:21:20 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp68772igt; Tue, 6 Nov 2012 08:21:18 -0800 (PST) Received: by 10.14.173.67 with SMTP id u43mr5028049eel.27.1352218878095; Tue, 06 Nov 2012 08:21:18 -0800 (PST) Received: from eu1sys200aog104.obsmtp.com (eu1sys200aog104.obsmtp.com [207.126.144.117]) by mx.google.com with SMTP id a9si1074423eeo.42.2012.11.06.08.21.09 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 06 Nov 2012 08:21:18 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.117 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.117; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.117 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob104.postini.com ([207.126.147.11]) with SMTP ID DSNKUJk49eoq9iRWMois/2SNiRSFX6uTrEW0@postini.com; Tue, 06 Nov 2012 16:21:17 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id 69FE94A; Tue, 6 Nov 2012 16:20:33 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id 58CE14E; Tue, 6 Nov 2012 11:38:53 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id AB927A8083; Tue, 6 Nov 2012 17:21:00 +0100 (CET) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Tue, 6 Nov 2012 17:21:06 +0100 From: Linus Walleij To: , , Shiraz Hashim , Viresh Kumar Cc: Stephen Warren , Anmar Oueja , Grant Likely , Linus Walleij Subject: [PATCH] gpiolib: iron out include ladder mistakes Date: Tue, 6 Nov 2012 17:21:03 +0100 Message-ID: <1352218863-2037-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmb4Q9m2CevseTZB2zTTe5JhhkVG94MVGJE6ahSzroExULKgbdnTWtA8566mqyTjZt991hh From: Linus Walleij The <*/gpio.h> includes are updated again: now we need to account for the problem introduced by commit: 595679a8038584df7b9398bf34f61db3c038bfea "gpiolib: fix up function prototypes etc" Actually we need static inlines in include/asm-generic/gpio.h as well since we may have GPIOLIB but not PINCTRL. And we need to keep the static inlines in but here for the !CONFIG_GENERIC_GPIO case, and then we may as well throw in a few warnings like the other prototypes there, if someone would have the bad taste of compiling without GENERIC_GPIO even. Signed-off-by: Linus Walleij --- include/asm-generic/gpio.h | 13 +++++++++++++ include/linux/gpio.h | 7 +++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 50d995e..b546edb 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h @@ -67,6 +67,19 @@ int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, unsigned int pin_base, unsigned int npins); void gpiochip_remove_pin_ranges(struct gpio_chip *chip); +#else + +static inline int +gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, + unsigned int pin_base, unsigned int npins) +{ +} + +static inline void +gpiochip_remove_pin_ranges(struct gpio_chip *chip) +{ +} + #endif /** diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 81bbfe5..7ba2762 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h @@ -231,21 +231,20 @@ static inline int irq_to_gpio(unsigned irq) return -EINVAL; } -#ifdef CONFIG_PINCTRL - static inline int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, unsigned int pin_base, unsigned int npins) { + WARN_ON(1); + return -EINVAL; } static inline void gpiochip_remove_pin_ranges(struct gpio_chip *chip) { + WARN_ON(1); } -#endif /* CONFIG_PINCTRL */ - #endif /* ! CONFIG_GENERIC_GPIO */ #endif /* __LINUX_GPIO_H */