From patchwork Thu Aug 27 20:03:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 7086981 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 90853BEEC1 for ; Thu, 27 Aug 2015 20:03:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 98A85209C0 for ; Thu, 27 Aug 2015 20:03:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8544E209BC for ; Thu, 27 Aug 2015 20:03:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751466AbbH0UDg (ORCPT ); Thu, 27 Aug 2015 16:03:36 -0400 Received: from andre.telenet-ops.be ([195.130.132.53]:45712 "EHLO andre.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751000AbbH0UDf (ORCPT ); Thu, 27 Aug 2015 16:03:35 -0400 Received: from ayla.of.borg ([31.5.182.137]) by andre.telenet-ops.be with bizsmtp id 9w3Y1r00C2yGKqv01w3Yy9; Thu, 27 Aug 2015 22:03:34 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1ZV3OV-0000Ze-VY; Thu, 27 Aug 2015 22:03:32 +0200 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1ZV3OY-0000mM-Id; Thu, 27 Aug 2015 22:03:34 +0200 From: Geert Uytterhoeven To: Laurent Pinchart , Linus Walleij , Simon Horman Cc: linux-sh@vger.kernel.org, linux-gpio@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] pinctrl: sh-pfc: Get rid of CONFIG_SHMOBILE_LEGACY Date: Thu, 27 Aug 2015 22:03:32 +0200 Message-Id: <1440705812-2960-1-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Shmobile is all multiplatform these days, so get rid of the reference to CONFIG_ARCH_SHMOBILE_LEGACY. Move the legacy code to do the non-DT mapping between GPIOs and pins inside the existing #ifdef CONFIG_SUPERH section. Signed-off-by: Geert Uytterhoeven Acked-by: Laurent Pinchart --- - Against renesas-devel-20150826-v4.2-rc8, - This must not be applied to a branch that still has CONFIG_SHMOBILE_LEGACY. drivers/pinctrl/sh-pfc/gpio.c | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/drivers/pinctrl/sh-pfc/gpio.c b/drivers/pinctrl/sh-pfc/gpio.c index 685b3c24627daf03..a917c62f07124b0b 100644 --- a/drivers/pinctrl/sh-pfc/gpio.c +++ b/drivers/pinctrl/sh-pfc/gpio.c @@ -341,7 +341,6 @@ int sh_pfc_register_gpiochip(struct sh_pfc *pfc) struct sh_pfc_chip *chip; phys_addr_t address; unsigned int i; - int ret; if (pfc->info->data_regs == NULL) return 0; @@ -379,29 +378,27 @@ int sh_pfc_register_gpiochip(struct sh_pfc *pfc) if (IS_ENABLED(CONFIG_OF) && pfc->dev->of_node) return 0; - if (IS_ENABLED(CONFIG_SUPERH) || - IS_ENABLED(CONFIG_ARCH_SHMOBILE_LEGACY)) { - /* - * Register the GPIO to pin mappings. As pins with GPIO ports - * must come first in the ranges, skip the pins without GPIO - * ports by stopping at the first range that contains such a - * pin. - */ - for (i = 0; i < pfc->nr_ranges; ++i) { - const struct sh_pfc_pin_range *range = &pfc->ranges[i]; - - if (range->start >= pfc->nr_gpio_pins) - break; - - ret = gpiochip_add_pin_range(&chip->gpio_chip, - dev_name(pfc->dev), range->start, range->start, - range->end - range->start + 1); - if (ret < 0) - return ret; - } +#ifdef CONFIG_SUPERH + /* + * Register the GPIO to pin mappings. As pins with GPIO ports + * must come first in the ranges, skip the pins without GPIO + * ports by stopping at the first range that contains such a + * pin. + */ + for (i = 0; i < pfc->nr_ranges; ++i) { + const struct sh_pfc_pin_range *range = &pfc->ranges[i]; + int ret; + + if (range->start >= pfc->nr_gpio_pins) + break; + + ret = gpiochip_add_pin_range(&chip->gpio_chip, + dev_name(pfc->dev), range->start, range->start, + range->end - range->start + 1); + if (ret < 0) + return ret; } -#ifdef CONFIG_SUPERH /* Register the function GPIOs chip. */ if (pfc->info->nr_func_gpios == 0) return 0;