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: 84093 Delivered-To: patch@linaro.org Received: by 10.182.1.168 with SMTP id 8csp51578obn; Fri, 25 Nov 2016 02:09:42 -0800 (PST) X-Received: by 10.84.133.36 with SMTP id 33mr15528915plf.6.1480068582359; Fri, 25 Nov 2016 02:09:42 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si15360056plj.245.2016.11.25.02.09.42; Fri, 25 Nov 2016 02:09:42 -0800 (PST) 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=neutral (body hash did not verify) header.i=@linaro.org; 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=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751264AbcKYKJl (ORCPT + 4 others); 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 --- drivers/gpio/gpio-pl061.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Sudeep Holla Tested-by: Sudeep Holla 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,