From patchwork Sat Oct 27 09:51:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 1654751 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 32DE33FD4F for ; Sat, 27 Oct 2012 09:54:02 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TS33t-0003kO-W7; Sat, 27 Oct 2012 09:52:14 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TS33h-0003jI-4M for linux-arm-kernel@lists.infradead.org; Sat, 27 Oct 2012 09:52:02 +0000 Received: by mail-pb0-f49.google.com with SMTP id xa7so3008778pbc.36 for ; Sat, 27 Oct 2012 02:52:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references:x-gm-message-state; bh=RYOkbxb1hcAMZlUPAYJk/xs10ANBD+4WcD3FHaWScXc=; b=pIIw/C8NVx9UBW3jtfF5BFkX0YX1OcT9Ww1EE9w/tyR8/9jH7hfdyuxuyI6j7cKx3M zf3Ws1O+Xdbb+EMuYM/czeg+xHgE2REQQoEfajl63+nMLkq2Y64C5GSgh2mfvlRNghd+ xpUyvc+pHdDtnOGD24KpncFpCfgfSYQqpgVE1vs6kB3VL7TVMUCTFWU9MLQ+K4jfZdul 2lyfs4dJQT/ptGiWM+uhBhXPEJGiJdit1ypcFBpny1jeb5w7Iron+xmizb+CM1MlysoG GtU0RSPtXsubPtEFUHv8XniuICrbI6EHWeSFfJBHEYx5rvRb2EmjG2/dbn0Fo9XsnA8H mJIQ== Received: by 10.68.213.6 with SMTP id no6mr37832820pbc.113.1351331520878; Sat, 27 Oct 2012 02:52:00 -0700 (PDT) Received: from localhost ([122.167.99.215]) by mx.google.com with ESMTPS id pj10sm2592681pbb.46.2012.10.27.02.51.58 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 27 Oct 2012 02:52:00 -0700 (PDT) From: Viresh Kumar To: linus.walleij@linaro.org Subject: [PATCH V2 1/5] Revert "pinctrl: remove pinctrl_remove_gpio_range" Date: Sat, 27 Oct 2012 15:21:35 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQmxqAhLoT5WCrrGQC7WCtCuUYoeGg4CFMZ23vU+dIfFc+8ihw5s9bFAxudQ138OxEcOuBV3 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Viresh Kumar , spear-devel@list.st.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This reverts earlier commit which removed pinctrl_remove_gpio_range(), because at that time there aren't any more users of that routine. It was removed as the removal of ranges was done in unregister of pinctrl. But because we are registering stuff from gpiolib now, we may remove and insert a gpio module multiple times. So, we need that again. Signed-off-by: Viresh Kumar --- This is V1 actually. Because it is part of this series, it is marked V2. drivers/pinctrl/core.c | 14 ++++++++++++++ include/linux/pinctrl/pinctrl.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index cec6072..b1086dc 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -346,6 +346,20 @@ void pinctrl_add_gpio_ranges(struct pinctrl_dev *pctldev, EXPORT_SYMBOL_GPL(pinctrl_add_gpio_ranges); /** + * pinctrl_remove_gpio_range() - remove a range of GPIOs fro a pin controller + * @pctldev: pin controller device to remove the range from + * @range: the GPIO range to remove + */ +void pinctrl_remove_gpio_range(struct pinctrl_dev *pctldev, + struct pinctrl_gpio_range *range) +{ + mutex_lock(&pinctrl_mutex); + list_del(&range->node); + mutex_unlock(&pinctrl_mutex); +} +EXPORT_SYMBOL_GPL(pinctrl_remove_gpio_range); + +/** * pinctrl_get_group_selector() - returns the group selector for a group * @pctldev: the pin controller handling the group * @pin_group: the pin group to look up diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index 7d087f0..eda0467 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h @@ -134,6 +134,8 @@ extern void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev, extern void pinctrl_add_gpio_ranges(struct pinctrl_dev *pctldev, struct pinctrl_gpio_range *ranges, unsigned nranges); +extern void pinctrl_remove_gpio_range(struct pinctrl_dev *pctldev, + struct pinctrl_gpio_range *range); extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev); extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); #else