From patchwork Wed Dec 9 13:21:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 58007 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp664744lbb; Wed, 9 Dec 2015 05:22:01 -0800 (PST) X-Received: by 10.66.193.73 with SMTP id hm9mr7832121pac.117.1449667321343; Wed, 09 Dec 2015 05:22:01 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bc9si12707724pad.140.2015.12.09.05.22.01; Wed, 09 Dec 2015 05:22:01 -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; 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; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754458AbbLINV7 (ORCPT + 4 others); Wed, 9 Dec 2015 08:21:59 -0500 Received: from mail-lb0-f173.google.com ([209.85.217.173]:35645 "EHLO mail-lb0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754444AbbLINV5 (ORCPT ); Wed, 9 Dec 2015 08:21:57 -0500 Received: by lbpu9 with SMTP id u9so29653688lbp.2 for ; Wed, 09 Dec 2015 05:21:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=+dVAi7Jq+yeToju99wNC83Kv4xcXUnzQRXJoUV8jf3o=; b=Sahq4A+jM8ekDlXsP7MGfi31hhjqKUwQfddq7ovSrAoER7YulBb5s4bClLMTjBv+Pb DHKJC5E9b+oZbqC74Xu52fOPuZT+GaSUx1nGqYH/K72PsrMfXhSHH4ZmB3io/cOZfr1w UvkBBXjfBqcwvrhi8aswZt3dBc9ytxMTzeCJf3ej9W3ewuPcBzdLIieTIuE0IGjhueQd 2movc4D60gGbSxnqUEXCbaQlY7V0U4sR/UWGd9D7ROPDHd1cOBwGkvNxP6R60IbvAyY4 8H7q+hZCezGZygJzWwRnqyNA74XfFmu6IbqNRt0rtP9JX85rkvckoWh2USv+jdXM7Q7r 1FtQ== 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=+dVAi7Jq+yeToju99wNC83Kv4xcXUnzQRXJoUV8jf3o=; b=ip83Z0ixtMOrULiQLqpN53/s/sxDtYD2cxpRO99XQzb/IAxG0/8UMFyFPxYsEcm6Dh iMkrdaigjcgdp5+UxqjI+j/s324N8oYmPoiH0w8O0lSwgZT1KjqVxplWea5qMPgGZE2+ a4yG8EaI6IYHfx6R/xx7nHSafFZoZ9974Pnq4KxGHOXXJLnRaxo8rQTJ+esgxA+0e0Kq sWOXjNsjwCBcOUwCr2MkUBFapxaPYyv0aG4nU0UyzH/Fpi5Gj/o6ir1QUIZsgXcI+jRn u34n3FykPGzkH/2IIfBdGTpDgd/5bjNqb/83eqw/0cscUm/Is/qpeuZyjJjK+JdllVDK brqA== X-Gm-Message-State: ALoCoQnQ8VW/qnO9iyO+/X5SIErjVSvYoP032V1Eykd4PKKsddz6tor3WJ2wIfZTZkP9t8uYLFVbRk0KxLNSg/L7M5dAUsdm+Q== X-Received: by 10.112.167.229 with SMTP id zr5mr2299939lbb.117.1449667315984; Wed, 09 Dec 2015 05:21:55 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id i7sm1434659lbo.39.2015.12.09.05.21.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 05:21:55 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Johan Hovold , Alexandre Courbot , Michael Welling , Markus Pargmann Cc: Linus Walleij , Robert Jarzmik , Daniel Mack Subject: [PATCH 052/182] gpio: pxa: use gpiochip data pointer Date: Wed, 9 Dec 2015 14:21:52 +0100 Message-Id: <1449667312-32244-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org This makes the driver use the data pointer added to the gpio_chip to store a pointer to the state container instead of relying on container_of(). Cc: Robert Jarzmik Cc: Daniel Mack Signed-off-by: Linus Walleij --- drivers/gpio/gpio-pxa.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.4.3 -- 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 diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c index bce99182578b..1f574a9f88fe 100644 --- a/drivers/gpio/gpio-pxa.c +++ b/drivers/gpio/gpio-pxa.c @@ -153,7 +153,8 @@ static struct pxa_gpio_id pxa1928_id = { static inline void __iomem *gpio_chip_base(struct gpio_chip *c) { - return container_of(c, struct pxa_gpio_chip, chip)->regbase; + struct pxa_gpio_chip *p = gpiochip_get_data(c); + return p->regbase; } static inline struct pxa_gpio_chip *gpio_to_pxachip(unsigned gpio) @@ -334,7 +335,7 @@ static int pxa_init_gpio_chip(int gpio_end, /* number of GPIOs on last bank may be less than 32 */ c->ngpio = (gpio + 31 > gpio_end) ? (gpio_end - gpio + 1) : 32; - gpiochip_add(c); + gpiochip_add_data(c, &chips[i]); } pxa_gpio_chips = chips; return 0;