From patchwork Thu Aug 27 20:07:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 7087011 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E43809F358 for ; Thu, 27 Aug 2015 20:07:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DF634209E2 for ; Thu, 27 Aug 2015 20:07:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EDB2D209E1 for ; Thu, 27 Aug 2015 20:07:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751466AbbH0UHX (ORCPT ); Thu, 27 Aug 2015 16:07:23 -0400 Received: from albert.telenet-ops.be ([195.130.137.90]:55638 "EHLO albert.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751000AbbH0UHX (ORCPT ); Thu, 27 Aug 2015 16:07:23 -0400 Received: from ayla.of.borg ([31.5.182.137]) by albert.telenet-ops.be with bizsmtp id 9w7M1r0192yGKqv06w7MqZ; Thu, 27 Aug 2015 22:07:22 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1ZV3SD-0000aS-P9; Thu, 27 Aug 2015 22:07:21 +0200 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1ZV3SG-0000tX-DA; Thu, 27 Aug 2015 22:07:24 +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_ARCH_SHMOBILE_LEGACY Date: Thu, 27 Aug 2015 22:07:23 +0200 Message-Id: <1440706043-3406-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: Linus Walleij --- - Against renesas-devel-20150826-v4.2-rc8, - This must not be applied to a branch that still has CONFIG_ARCH_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;