From patchwork Wed Dec 9 13:15:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 57979 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp661187lbb; Wed, 9 Dec 2015 05:16:08 -0800 (PST) X-Received: by 10.66.120.200 with SMTP id le8mr7797606pab.61.1449666968166; Wed, 09 Dec 2015 05:16:08 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s26si12711651pfi.57.2015.12.09.05.16.07; Wed, 09 Dec 2015 05:16:08 -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 S1752952AbbLINQH (ORCPT + 4 others); Wed, 9 Dec 2015 08:16:07 -0500 Received: from mail-lb0-f174.google.com ([209.85.217.174]:33817 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752672AbbLINQG (ORCPT ); Wed, 9 Dec 2015 08:16:06 -0500 Received: by lbbcs9 with SMTP id cs9so29683521lbb.1 for ; Wed, 09 Dec 2015 05:16:04 -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=pp1dpJ6qtTxPhGTzUeYhVTNxXXAN5W8sNcpjyrVvXGI=; b=k121mFdamzhZCizml4XHxiFw+l7oJIC2YC44cgxyPx6vJSnTSO0hsNvxcnCXJ83Qxf 4w3g2NL2hCagqj8J7F/2IL6kU7RZxFLc9+Aq8VSc8v///xrZ3prWQGYEyQNznMF+dLWb FZ2a5IZvp10rvG0pSLARi3N5AwIli/AyIRVJJV2W/XGnLrnze9eS9idbTKEx3aHurFfO IWouE15zdntwKmNVg1ChWA+LU9fGoxgRmavwAhS+lGkkSiZ5uV1ky80XudlBl9g7WGrt d/Sew4g2TQroC50q61V6o6l3ZZk85vUAWtYJUr6i1cnhKznM5D8n8W5S85rGneWaiUyi Xo5A== 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=pp1dpJ6qtTxPhGTzUeYhVTNxXXAN5W8sNcpjyrVvXGI=; b=ApeXg3OVOWPJEYV7UAC+gqz725dzVvuG8EcYg+FIQ4vEu0SjIXwwgXvv/WXpAWt5Jq Rj5o7MCeJmf3/WFo0vpR/CeEErLm2yrTHLRZwC84DkS/lmrSeGQV0etr1or56yNW9+aO tLb5uqSFEfngyg8V1SqhbY0J9ZDM5eccAYApQtXWyH74ZL7A4TkjBDuzIUbug0ceIGCK TnDrNhQlIu2WYemJ0NRHSCEQdFkUzQ53nAVzkmhrH+vuxnSFwl9LCCYZEHz59wvgQrv6 Y8aZCH+aXr6UcXeueGCe0KjxJasNae30evW/riubLnglgsYXzulJednqXnJH+XDTL0z0 M0PQ== X-Gm-Message-State: ALoCoQl2AhUAt7L70VffBwddn04e5jWtia2rSWGap8o5eKyTa3AUNhz0YwXK4z3etSClTm2yPwn72vA2l7pWJOi4ftSJDP4wyQ== X-Received: by 10.112.200.138 with SMTP id js10mr1980204lbc.48.1449666964607; Wed, 09 Dec 2015 05:16:04 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id dz6sm1421497lbb.17.2015.12.09.05.16.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 05:16:03 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Johan Hovold , Alexandre Courbot , Michael Welling , Markus Pargmann Cc: Linus Walleij , Geert Uytterhoeven , Magnus Damm Subject: [PATCH 024/182] gpio: em: use gpiochip data pointer Date: Wed, 9 Dec 2015 14:15:59 +0100 Message-Id: <1449666959-30882-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: Geert Uytterhoeven Cc: Magnus Damm Signed-off-by: Linus Walleij --- drivers/gpio/gpio-em.c | 4 ++-- 1 file changed, 2 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-em.c b/drivers/gpio/gpio-em.c index c3ca2b1c1dfe..faa98f0388b5 100644 --- a/drivers/gpio/gpio-em.c +++ b/drivers/gpio/gpio-em.c @@ -192,7 +192,7 @@ static irqreturn_t em_gio_irq_handler(int irq, void *dev_id) static inline struct em_gio_priv *gpio_to_priv(struct gpio_chip *chip) { - return container_of(chip, struct em_gio_priv, gpio_chip); + return gpiochip_get_data(chip); } static int em_gio_direction_input(struct gpio_chip *chip, unsigned offset) @@ -368,7 +368,7 @@ static int em_gio_probe(struct platform_device *pdev) goto err1; } - ret = gpiochip_add(gpio_chip); + ret = gpiochip_add_data(gpio_chip, p); if (ret) { dev_err(&pdev->dev, "failed to add GPIO controller\n"); goto err1;