From patchwork Fri Nov 25 10:09:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 699145 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3tQBdL4FJcz9syB for ; Fri, 25 Nov 2016 21:09:42 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="FIkr8e4j"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751264AbcKYKJl (ORCPT ); Fri, 25 Nov 2016 05:09:41 -0500 Received: from mail-lf0-f51.google.com ([209.85.215.51]:35881 "EHLO mail-lf0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750801AbcKYKJj (ORCPT ); Fri, 25 Nov 2016 05:09:39 -0500 Received: by mail-lf0-f51.google.com with SMTP id t196so46963006lff.3 for ; Fri, 25 Nov 2016 02:09:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=ghtwR///koscs3iEvn5Q0m2/oFDcU+HHLT+wR1VMf8A=; b=FIkr8e4jlWySUEZTbg8QycyKPQ3xkUj6ZPZiFqJOrKZcdoQ9ZSyfTV2LA40+qXuJLx PiJQa93MydJzQgMei+s+uIrdyrFXOHVUeREoZYWcffHT9EZibGtNzPipSNIUq5uuawPt ojKBzfEWPU0g2mt9TOPWWtO5UY8rU18IklmoQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ghtwR///koscs3iEvn5Q0m2/oFDcU+HHLT+wR1VMf8A=; b=ihP4qLcKyCIBRnpGstrDhE5AvUZ8O726MIL7SyFEGaoXbssoom0/ga+eSon/loqN6H pu5FS3Erkp/NIqsFvlIFu/uRC+frBdZHuAxxzVJl8IvOsvibDeyxMqkY7eWXz7ry53cN ger7fwTMvjEIqrOycz2wapLqnrpzWzFt66KL6vEUSgYhu7B1mfKXY/s+TPhF1gqq0UAZ 1Co7j5MdcdUSE6znfytvU0exrwAHFyYP+GjC5UKteDIyaQw82zEN+LXFp1IPYTztysuI uawKsCEoza/Pwot9Z4Hkm6/4vPTn1ejYxe3qppd6grNelMFXyJcDHf+k1+dzzpBOtBed dAcw== X-Gm-Message-State: AKaTC03ol1zJYKAIENQpfQ3+1wLDU/yR7jLLMYWUJErHmf+CE0ZV6bgl3OliGf3ahszrlrTt X-Received: by 10.25.24.106 with SMTP id o103mr3086102lfi.74.1480068577394; Fri, 25 Nov 2016 02:09:37 -0800 (PST) Received: from linuslaptop.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id c78sm5088022lfc.39.2016.11.25.02.09.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Nov 2016 02:09:36 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Alexandre Courbot , linux-arm-kernel@lists.infradead.org, Baruch Siach Cc: Sudeep Holla , Haojian Zhuang , Linus Walleij Subject: [PATCH 1/5] gpio: pl061: use local state for parent IRQ storage Date: Fri, 25 Nov 2016 11:09:20 +0100 Message-Id: <1480068564-9447-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The driver is poking around in the struct gpio_chip internals, which is a no-no. Use a variable in the local state container. Signed-off-by: Linus Walleij Acked-by: Sudeep Holla Tested-by: Sudeep Holla --- drivers/gpio/gpio-pl061.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c index 6e3c1430616f..8838a44351ce 100644 --- a/drivers/gpio/gpio-pl061.c +++ b/drivers/gpio/gpio-pl061.c @@ -55,6 +55,7 @@ struct pl061_gpio { void __iomem *base; struct gpio_chip gc; + int parent_irq; #ifdef CONFIG_PM struct pl061_context_save_regs csave_regs; @@ -276,8 +277,9 @@ static void pl061_irq_ack(struct irq_data *d) static int pl061_irq_set_wake(struct irq_data *d, unsigned int state) { struct gpio_chip *gc = irq_data_get_irq_chip_data(d); + struct pl061_gpio *chip = gpiochip_get_data(gc); - return irq_set_irq_wake(gc->irq_parent, state); + return irq_set_irq_wake(chip->parent_irq, state); } static struct irq_chip pl061_irqchip = { @@ -345,6 +347,7 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id) dev_err(&adev->dev, "invalid IRQ\n"); return -ENODEV; } + chip->parent_irq = irq; ret = gpiochip_irqchip_add(&chip->gc, &pl061_irqchip, irq_base, handle_bad_irq,