From patchwork Wed Dec 9 13:27:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 58034 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp667928lbb; Wed, 9 Dec 2015 05:27:43 -0800 (PST) X-Received: by 10.98.42.209 with SMTP id q200mr12995348pfq.1.1449667663554; Wed, 09 Dec 2015 05:27:43 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ny6si12718088pab.215.2015.12.09.05.27.43; Wed, 09 Dec 2015 05:27:43 -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 S1754086AbbLIN1n (ORCPT + 4 others); Wed, 9 Dec 2015 08:27:43 -0500 Received: from mail-lf0-f47.google.com ([209.85.215.47]:36179 "EHLO mail-lf0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753754AbbLIN1m (ORCPT ); Wed, 9 Dec 2015 08:27:42 -0500 Received: by lfs39 with SMTP id 39so34357862lfs.3 for ; Wed, 09 Dec 2015 05:27:41 -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=WCGCpAA/NHFSUtqYZ8JmMjuVdPSt/x97M2q+omF/ZIQ=; b=KF8J2WIlv+zy2GxBEmyP4wKITyaKRyaWoJSsCfrPx/eZ6Ln65Z//o8gUlvCPwERe8e N6eCeKqZSWLdrK4Qst69Ce+Q9E2L/5KQPesbp9wiCLBb7kMHmnaiePiPJWbU4UVGC0Iz gKo2HUZ8TqSTwFIZ0nQTriqL/25toozYwAV61eT/bHZqu558tPfKc69lhXEQZAs1C4zv ErFH54rsQdFJMlYhnylOvFmk9040b6CnGCiB3hgJvp0YT5ZypQ7UJMcLp6mXdzZ7EosD 9YEMxd0Cq+lxcjC8SdSHDR4gBRntaHhEseK8+GIRKu+39s9taabGbmqNXyg1k76EGfDu 02hw== 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=WCGCpAA/NHFSUtqYZ8JmMjuVdPSt/x97M2q+omF/ZIQ=; b=kA61hb+asV1RBvbBUjkuITRxRWhHK++pCL4Yxdx5Skte1WauU4zo3EWylRqclsGoIg 9KEPZ8nS91h5h79FDbjt83nlnEao7N1xrV76kkz4vTcATF2KvJjBIWi5FtXECF7ymv+r fKt7j0CAoY4oRHgeh4bEZVKDDzr/N3zc+zr+ara7NXTJvukwij7M2uyOXDeWy9Dyed94 YOO1gVOv9VvI89eHzjocV12XUExF8ekAh5voeTAO0iA17ST1PM/MkV+WF1aBVxzWkIDd +CgwCXyjJLPTZ+QMs86sXNfIo2WH+Tj48XEUntKeeDclLaQBOiXXFlnv9nocJ/j845uH P5hA== X-Gm-Message-State: ALoCoQnuZ8IVvvOvNd+E8k4PnU8HF2DYuZXcP9IcPGv0RqHNiqVRu+YnCLCj7EoBLmNHf8eYBt+kLHQ0tcXEeCFVqFgh5kQlCA== X-Received: by 10.25.24.67 with SMTP id o64mr2195330lfi.135.1449667661088; Wed, 09 Dec 2015 05:27:41 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id m70sm1437911lfb.17.2015.12.09.05.27.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 05:27:40 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Johan Hovold , Alexandre Courbot , Michael Welling , Markus Pargmann Cc: Linus Walleij Subject: [PATCH 078/182] gpio: vx855: use gpiochip data pointer Date: Wed, 9 Dec 2015 14:27:38 +0100 Message-Id: <1449667658-1109-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(). Signed-off-by: Linus Walleij --- drivers/gpio/gpio-vx855.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 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-vx855.c b/drivers/gpio/gpio-vx855.c index 57b470d5b39e..764999cc0794 100644 --- a/drivers/gpio/gpio-vx855.c +++ b/drivers/gpio/gpio-vx855.c @@ -96,7 +96,7 @@ static inline u_int32_t gpio_o_bit(int i) static int vx855gpio_direction_input(struct gpio_chip *gpio, unsigned int nr) { - struct vx855_gpio *vg = container_of(gpio, struct vx855_gpio, gpio); + struct vx855_gpio *vg = gpiochip_get_data(gpio); unsigned long flags; u_int32_t reg_out; @@ -120,7 +120,7 @@ static int vx855gpio_direction_input(struct gpio_chip *gpio, static int vx855gpio_get(struct gpio_chip *gpio, unsigned int nr) { - struct vx855_gpio *vg = container_of(gpio, struct vx855_gpio, gpio); + struct vx855_gpio *vg = gpiochip_get_data(gpio); u_int32_t reg_in; int ret = 0; @@ -146,7 +146,7 @@ static int vx855gpio_get(struct gpio_chip *gpio, unsigned int nr) static void vx855gpio_set(struct gpio_chip *gpio, unsigned int nr, int val) { - struct vx855_gpio *vg = container_of(gpio, struct vx855_gpio, gpio); + struct vx855_gpio *vg = gpiochip_get_data(gpio); unsigned long flags; u_int32_t reg_out; @@ -259,7 +259,7 @@ static int vx855gpio_probe(struct platform_device *pdev) vx855gpio_gpio_setup(vg); - return gpiochip_add(&vg->gpio); + return gpiochip_add_data(&vg->gpio, vg); } static int vx855gpio_remove(struct platform_device *pdev)