From patchwork Mon Mar 18 11:05:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 2288291 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 502B5DF215 for ; Mon, 18 Mar 2013 11:21:56 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UHY5K-0006RY-C2; Mon, 18 Mar 2013 11:18:34 +0000 Received: from kirsty.vergenet.net ([202.4.237.240]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UHXum-0002B9-Qq for linux-arm-kernel@lists.infradead.org; Mon, 18 Mar 2013 11:08:03 +0000 Received: from ayumi.akashicho.tokyo.vergenet.net (p8120-ipbfp1001kobeminato.hyogo.ocn.ne.jp [118.10.137.120]) by kirsty.vergenet.net (Postfix) with ESMTP id 953A026716A; Mon, 18 Mar 2013 22:07:26 +1100 (EST) Received: by ayumi.akashicho.tokyo.vergenet.net (Postfix, from userid 7100) id 566A2EDE148; Mon, 18 Mar 2013 20:07:24 +0900 (JST) From: Simon Horman To: Arnd Bergmann , Olof Johansson Subject: [PATCH 022/142] sh-pfc: Replace pinctrl_add_gpio_range() with gpiochip_add_pin_range() Date: Mon, 18 Mar 2013 20:05:18 +0900 Message-Id: <1363604838-29359-23-git-send-email-horms+renesas@verge.net.au> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1363604838-29359-1-git-send-email-horms+renesas@verge.net.au> References: <1363604838-29359-1-git-send-email-horms+renesas@verge.net.au> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130318_070741_464260_C4EF989A X-CRM114-Status: GOOD ( 12.76 ) X-Spam-Score: -5.1 (-----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-5.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [202.4.237.240 listed in list.dnswl.org] -2.5 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Laurent Pinchart , linux-sh@vger.kernel.org, Linus Walleij , Magnus Damm , arm@kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Laurent Pinchart Adding a GPIO range to a pinctrl device logically belongs to the GPIO driver. Switch to the right API. Signed-off-by: Laurent Pinchart Acked-by: Linus Walleij --- drivers/pinctrl/sh-pfc/gpio.c | 6 ++++++ drivers/pinctrl/sh-pfc/pinctrl.c | 9 --------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/pinctrl/sh-pfc/gpio.c b/drivers/pinctrl/sh-pfc/gpio.c index 45090d8..32a9c78 100644 --- a/drivers/pinctrl/sh-pfc/gpio.c +++ b/drivers/pinctrl/sh-pfc/gpio.c @@ -220,6 +220,7 @@ sh_pfc_add_gpiochip(struct sh_pfc *pfc, void(*setup)(struct sh_pfc_chip *)) int sh_pfc_register_gpiochip(struct sh_pfc *pfc) { struct sh_pfc_chip *chip; + int ret; chip = sh_pfc_add_gpiochip(pfc, gpio_pin_setup); if (IS_ERR(chip)) @@ -227,6 +228,11 @@ int sh_pfc_register_gpiochip(struct sh_pfc *pfc) pfc->gpio = chip; + ret = gpiochip_add_pin_range(&chip->gpio_chip, dev_name(pfc->dev), 0, 0, + chip->gpio_chip.ngpio); + if (ret < 0) + return ret; + chip = sh_pfc_add_gpiochip(pfc, gpio_function_setup); if (IS_ERR(chip)) return PTR_ERR(chip); diff --git a/drivers/pinctrl/sh-pfc/pinctrl.c b/drivers/pinctrl/sh-pfc/pinctrl.c index 78bd277..a60c317 100644 --- a/drivers/pinctrl/sh-pfc/pinctrl.c +++ b/drivers/pinctrl/sh-pfc/pinctrl.c @@ -28,7 +28,6 @@ struct sh_pfc_pinctrl { struct pinctrl_dev *pctl; struct pinctrl_desc pctl_desc; - struct pinctrl_gpio_range range; struct sh_pfc *pfc; @@ -377,14 +376,6 @@ int sh_pfc_register_pinctrl(struct sh_pfc *pfc) if (IS_ERR(pmx->pctl)) return PTR_ERR(pmx->pctl); - pmx->range.name = DRV_NAME, - pmx->range.id = 0; - pmx->range.npins = pfc->info->nr_pins; - pmx->range.base = 0; - pmx->range.pin_base = 0; - - pinctrl_add_gpio_range(pmx->pctl, &pmx->range); - return 0; }