From patchwork Fri Oct 25 13:48:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 21251 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f69.google.com (mail-qe0-f69.google.com [209.85.128.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0817824500 for ; Fri, 25 Oct 2013 13:48:23 +0000 (UTC) Received: by mail-qe0-f69.google.com with SMTP id 6sf9379355qeb.4 for ; Fri, 25 Oct 2013 06:48:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=YZjaNI+RvbUd2xIGWIyze4Sw4IYWSHUh/Wt+KaVSY40=; b=RmlvQAEEVONVIsk7LuePXbSmsolrPU8WFAiokRtQHDHKstTB/6L6LyKxZ+rkTQmeMD M8vi3DtEayjLGPN+u0LGAxODasaenQJzcgAlVXL3kTH4THL4M3s2BxhFxFhPp1jdJhhk b+QRE9PklWDJbShnEEtGWc4LnbjoOtwC1bkoVaCG8S7C/iFWdV4oR003e+Q1wY1SFtRY 9C7YWR8zwsDuGzDGgyVc4HkIARCxZEyCN/oQifQ0jnMMhjI8nhJMoXmk1JMMXWK+vLDI tir+06cl7Du+9q76BGpRt2PNN35XFyXrHre1NlFwR3Cjhsj4BDagi9IGhvLLIh1Boc28 0A/g== X-Gm-Message-State: ALoCoQlOV4+nsKCXDgWLUqZMgquy3OSfH87B+b0AY9CUit1+qiL6Vr7ZdRESJT/xZyMZjcg3rudH X-Received: by 10.52.109.164 with SMTP id ht4mr2783469vdb.8.1382708903204; Fri, 25 Oct 2013 06:48:23 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.128.229 with SMTP id nr5ls1205660qeb.94.gmail; Fri, 25 Oct 2013 06:48:23 -0700 (PDT) X-Received: by 10.58.232.228 with SMTP id tr4mr12077vec.34.1382708903083; Fri, 25 Oct 2013 06:48:23 -0700 (PDT) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by mx.google.com with ESMTPS id gq10si1651188vdc.121.2013.10.25.06.48.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Oct 2013 06:48:23 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.44 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.44; Received: by mail-vb0-f44.google.com with SMTP id 11so2462805vbe.31 for ; Fri, 25 Oct 2013 06:48:23 -0700 (PDT) X-Received: by 10.52.164.102 with SMTP id yp6mr4097851vdb.14.1382708902963; Fri, 25 Oct 2013 06:48:22 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp474904vcz; Fri, 25 Oct 2013 06:48:22 -0700 (PDT) X-Received: by 10.194.119.106 with SMTP id kt10mr1807560wjb.72.1382708901925; Fri, 25 Oct 2013 06:48:21 -0700 (PDT) Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by mx.google.com with ESMTPS id cx8si2962944wjb.110.2013.10.25.06.48.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Oct 2013 06:48:21 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.175 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.212.175; Received: by mail-wi0-f175.google.com with SMTP id hm4so1098945wib.14 for ; Fri, 25 Oct 2013 06:48:21 -0700 (PDT) X-Received: by 10.180.211.111 with SMTP id nb15mr2563187wic.55.1382708901339; Fri, 25 Oct 2013 06:48:21 -0700 (PDT) Received: from localhost.localdomain.quadriga.com (ip-77-221-165-98.dsl.twang.net. [77.221.165.98]) by mx.google.com with ESMTPSA id fr4sm6293049wib.0.2013.10.25.06.48.19 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Fri, 25 Oct 2013 06:48:20 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Alexandre Courbot , Linus Walleij Subject: [PATCH] gpio: provide stubs for devres gpio functions Date: Fri, 25 Oct 2013 15:48:11 +0200 Message-Id: <1382708891-12071-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.3.1 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.44 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , commit 6b3d8145dcfdbbb43f13544e16f44f4574f941dd "gpiolib: make GPIO_DEVRES depend on GPIOLIB" breaks builds when device drivers are using devm_gpio* devres functions without enabling GPIOLIB, relying on the devres code to be compiled anyway. Provide stubs so that we get these if we're using the devres functions without GPIOLIB. Reported-by: Fengguang Wu Cc: Alexandre Courbot Signed-off-by: Linus Walleij --- include/linux/gpio.h | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/include/linux/gpio.h b/include/linux/gpio.h index c691df044458..09e0906333a2 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h @@ -77,6 +77,15 @@ static inline int irq_to_gpio(unsigned int irq) #endif /* ! CONFIG_ARCH_HAVE_CUSTOM_GPIO_H */ +/* CONFIG_GPIOLIB: bindings for managed devices that want to request gpios */ + +struct device; + +int devm_gpio_request(struct device *dev, unsigned gpio, const char *label); +int devm_gpio_request_one(struct device *dev, unsigned gpio, + unsigned long flags, const char *label); +void devm_gpio_free(struct device *dev, unsigned int gpio); + #else /* ! CONFIG_GPIOLIB */ #include @@ -241,14 +250,25 @@ gpiochip_remove_pin_ranges(struct gpio_chip *chip) WARN_ON(1); } -#endif /* ! CONFIG_GPIOLIB */ - -struct device; +static inline int devm_gpio_request(struct device *dev, unsigned gpio, + const char *label) +{ + WARN_ON(1); + return -EINVAL; +} -/* bindings for managed devices that want to request gpios */ -int devm_gpio_request(struct device *dev, unsigned gpio, const char *label); int devm_gpio_request_one(struct device *dev, unsigned gpio, - unsigned long flags, const char *label); -void devm_gpio_free(struct device *dev, unsigned int gpio); + unsigned long flags, const char *label) +{ + WARN_ON(1); + return -EINVAL; +} + +void devm_gpio_free(struct device *dev, unsigned int gpio) +{ + WARN_ON(1); +} + +#endif /* ! CONFIG_GPIOLIB */ #endif /* __LINUX_GPIO_H */