From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Chou Subject: [PATCH 2/3] of: of_gpiochip_add is needed only for gpiolib Date: Mon, 31 Jan 2011 23:25:50 +0800 Message-ID: <1296487551-30938-2-git-send-email-thomas@wytron.com.tw> References: Return-path: In-Reply-To: Sender: linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Haavard Skinnemoen , Grant Likely , Ben Dooks Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, nios2-dev-1eJk0qcHJCcaeqlQEoCUNoJY59XmG8rH@public.gmane.org, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Jean Delvare , Thomas Chou List-Id: devicetree@vger.kernel.org Some gpio drivers may not use gpiolib. In this case, struct gpio_chip is not defined and of_gpiochip_add/remove are not needed. Signed-off-by: Thomas Chou --- include/linux/of_gpio.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h index 6598c04..fc96af0 100644 --- a/include/linux/of_gpio.h +++ b/include/linux/of_gpio.h @@ -71,9 +71,13 @@ static inline unsigned int of_gpio_count(struct device_node *np) return 0; } +#ifdef CONFIG_GPIOLIB + static inline void of_gpiochip_add(struct gpio_chip *gc) { } static inline void of_gpiochip_remove(struct gpio_chip *gc) { } +#endif /* CONFIG_GPIOLIB */ + #endif /* CONFIG_OF_GPIO */ /** -- 1.7.3.5