From patchwork Thu Sep 13 12:06:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 146628 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp523184ljw; Thu, 13 Sep 2018 05:06:43 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbF9Cqtp9iEDRieKYteL4Ek3z1V9UbiRzVVveKaOxaetwHSXk8/eAs9OuoGFvaTND8XKYMo X-Received: by 2002:a63:df04:: with SMTP id u4-v6mr7054869pgg.434.1536840403509; Thu, 13 Sep 2018 05:06:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536840403; cv=none; d=google.com; s=arc-20160816; b=CjvKcy/XAloIBWJy5cc7DAiCICq0FqysJbXN7uvH1l4Jkvj8eWx+NOEXcyYrBUPXCB GKUnjzVne1lmnW+7sv5jePGTQpsffbTiI8VlnDQn1mfMUOnEKfcuUR6BTgHzgxSCcRyJ 6/jFewBrFuf1Ir0bxK2tuTgqbe+TfldqBN7y+FmVwBW3PTpVbWlJyY5tRUI77HR8MW2K q9n0EJiMWjcENnH6sOxLZWolqd7WzMe6zYXx84VbEXDL1zXnh6eKTUVkBDADIN8lQzT1 ybVfcEwfzrmArCD6HBiwsL1ttefQgo4BBeL3URmMg5NBWPOpDkaJMbO87hjXucr9DP0e O7Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=KPv0XecvRzuT11iAzIpAjT03WQKdmDjMAMZeRiXLtbg=; b=n19ufyEqVaKAZqS0rjBZpUjM6XADMbWfaMxE+rDOJDegkRdhp/iRIe9t3Xl1ep7xit zyC0aecanz0tj58gqRHKrfEqdP0pXWx6Mx34Deho1nHQn882cqaP6CZRXz0OoH2NC3D0 PYVbzNT8eaSapBpljMpmX6skJviYy1sAV+b85epLAHV8oVjyCmXEZPfxaHznHx2NVuwN tHIGHptPdO9tVHc+eL42fRJ7zXwtxhfXmmdfTZNNJdAqudLey7mEBODmlKIgaVUDQDus OHI5vR5kUsBeQJKLhpHFYYvr69gwD4sQ8E1RZMd+FgNHGQXwTTN/oU6EwZZ8+4ZjdGyB hGOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="K8BYkS/k"; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5-v6si4008414plt.342.2018.09.13.05.06.43; Thu, 13 Sep 2018 05:06:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="K8BYkS/k"; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727009AbeIMRPw (ORCPT + 5 others); Thu, 13 Sep 2018 13:15:52 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:32889 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726932AbeIMRPw (ORCPT ); Thu, 13 Sep 2018 13:15:52 -0400 Received: by mail-lf1-f66.google.com with SMTP id m26-v6so4594282lfb.0 for ; Thu, 13 Sep 2018 05:06:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=KPv0XecvRzuT11iAzIpAjT03WQKdmDjMAMZeRiXLtbg=; b=K8BYkS/kthN0gMbMHfeoxqcRW5yL+FVPZe52OQ21plXy1nDp2Mr3M6B/IFYtQpLtxB mCHE7Rh+2F7DoORe1bME9Tf+NqY1/7xT83IuQhmE60WSfqWmPbyOaClcV/HBx+iRB5Ay XM4BvrRh4/O9ymjL14MNAXNYPacnSDy0s0L+U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=KPv0XecvRzuT11iAzIpAjT03WQKdmDjMAMZeRiXLtbg=; b=SXynSsj08g/dxoqDh4l1FycH7EEUq7zTBtq+svwSM8khoO5tWtm4usp30jQjR2Gi4r gvIX3H8zN8HkHKdV5C/+6nf6/yAdOzvsJcvod8WfZ7BwuJ6sZrP39yO7Bm2x7WdGXyzo c7H77AJZQSVbhNy3oKl9UBzIL4S2rXCKh9B8XDXCn5qb5RifAbaejCskCEiJ/mp8r1lB TfLYVaHqE12U8tJtqy+H6AV+7OiR0EKoMQfXH7+6jdhq5z4X9nDOgwQoNiO4ASL6Oux2 m1o0jZ2ubcsQMZFLh3C7VLByrNyWpEIFqdbiiz8cWxi1jwqTeBG/yOAqxgzm4fSaAAAZ 0n1w== X-Gm-Message-State: APzg51A9JTk+R7Qz2y9cLqD64KSMUqaMdESw+sOm0OmXsgTpbeg5fWv0 cLd5ix3tPwEOnMPt7bnDr4OPccT0NqM= X-Received: by 2002:ac2:418b:: with SMTP id z11-v6mr4488056lfh.3.1536840399976; Thu, 13 Sep 2018 05:06:39 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id z5-v6sm678334lfg.75.2018.09.13.05.06.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Sep 2018 05:06:38 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Ludovic Desroches , Alexandre Belloni Subject: [PATCH] pinctrl: at91-pio4: Get rid of legacy call Date: Thu, 13 Sep 2018 14:06:36 +0200 Message-Id: <20180913120636.28430-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org By just moving the atmel_gpio_to_irq() and calling the internal function we can get rid of the driver calling back out into the deprecated external consumer API. Cc: Ludovic Desroches Cc: Alexandre Belloni Signed-off-by: Linus Walleij --- drivers/pinctrl/pinctrl-at91-pio4.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) -- 2.17.1 Acked-by: Ludovic Desroches diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c index ef7ab208b951..9c76d9d358cc 100644 --- a/drivers/pinctrl/pinctrl-at91-pio4.c +++ b/drivers/pinctrl/pinctrl-at91-pio4.c @@ -17,8 +17,6 @@ #include #include #include -/* FIXME: needed for gpio_to_irq(), get rid of this */ -#include #include #include #include @@ -264,6 +262,13 @@ static struct irq_chip atmel_gpio_irq_chip = { .irq_set_wake = atmel_gpio_irq_set_wake, }; +static int atmel_gpio_to_irq(struct gpio_chip *chip, unsigned offset) +{ + struct atmel_pioctrl *atmel_pioctrl = gpiochip_get_data(chip); + + return irq_find_mapping(atmel_pioctrl->irq_domain, offset); +} + static void atmel_gpio_irq_handler(struct irq_desc *desc) { unsigned int irq = irq_desc_get_irq(desc); @@ -297,7 +302,7 @@ static void atmel_gpio_irq_handler(struct irq_desc *desc) break; for_each_set_bit(n, &isr, BITS_PER_LONG) - generic_handle_irq(gpio_to_irq(bank * + generic_handle_irq(atmel_gpio_to_irq(chip, bank * ATMEL_PIO_NPINS_PER_BANK + n)); } @@ -360,13 +365,6 @@ static void atmel_gpio_set(struct gpio_chip *chip, unsigned offset, int val) BIT(pin->line)); } -static int atmel_gpio_to_irq(struct gpio_chip *chip, unsigned offset) -{ - struct atmel_pioctrl *atmel_pioctrl = gpiochip_get_data(chip); - - return irq_find_mapping(atmel_pioctrl->irq_domain, offset); -} - static struct gpio_chip atmel_gpio_chip = { .direction_input = atmel_gpio_direction_input, .get = atmel_gpio_get,