From patchwork Wed Dec 9 13:18:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 57998 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp662849lbb; Wed, 9 Dec 2015 05:18:50 -0800 (PST) X-Received: by 10.98.16.71 with SMTP id y68mr13028505pfi.108.1449667130061; Wed, 09 Dec 2015 05:18:50 -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.18.49; Wed, 09 Dec 2015 05:18:50 -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 S1754080AbbLINSt (ORCPT + 4 others); Wed, 9 Dec 2015 08:18:49 -0500 Received: from mail-lb0-f174.google.com ([209.85.217.174]:34116 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751673AbbLINSt (ORCPT ); Wed, 9 Dec 2015 08:18:49 -0500 Received: by lbbcs9 with SMTP id cs9so29729833lbb.1 for ; Wed, 09 Dec 2015 05:18:47 -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=LEA1/cbHv+04tDWC8LG/MrqitAAZho5mMxxMju+wAGc=; b=FgppNY38i+BengPqqok6Y7FdfJLupAoQp2e0U6xgbGgK/GZpEjv1FwC3Dnuoj2wa9R iltZON2RTYgV6/v0fOL44MhDrlzAKeilqtOnqblMP1+md+kyE6dMoMHn685vtQDYJtHZ Ejo5z3c4Ehvhu1s5Jkjv+ZZxOy22jV81gt7znFph1tYRRWu2dV9CfJpDIxfiJcW1OsBT xFa0yj5hfHlnRzKtgaS6XE/GV+3f3weYnRFKZRt7532LZsz+QKuFSLvVtnEp1iStbQGn L9XxbXrjvHl7QHo/SKFzdtcmp5NBI/WcdYe41nfKIcJxVilxjVdHfp3YYlGHQfVIYKKh zgCw== 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=LEA1/cbHv+04tDWC8LG/MrqitAAZho5mMxxMju+wAGc=; b=MbkIhA/pYbIFUrKV12qRAtvLSE67h5vbeCvIeK0owBpOraQx66cikNsir/j1toyyik kIyq37deu5zlCxV5JeGfdDiKzXQEwmeZmELMlbz/CkhYRDG/2DJly1U0C1WEG33DQeXC ZM8lgGuYQ2bSsGKR4x7WF87dKmFQIb4/tb8yTJxz+mXuNRDNEIInY41duwSgIleUaDlw 5duNNTN71BK3EmbxHBCqHQA0K0DhlCfjF0tRL0hXom2duQhk0ia7qF5IOOf1a7Cj/K9Z YOhbQZmYz3HMeJEdxIiIS/2OeZeD06QdBvH7WcJQw4GFOT3iG07uTkQjG4/i+wAXjLFV 3ohg== X-Gm-Message-State: ALoCoQnI2OjJF+WpVPkm/6kGUXkb3LnoRjUnooSo+e6ChtIMrFKBod8X5EtFaSCrgjKyXXLDB27J0hli/6VgH/STPvmLWD7TNA== X-Received: by 10.112.157.101 with SMTP id wl5mr2371892lbb.88.1449667127663; Wed, 09 Dec 2015 05:18:47 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id xn8sm1412546lbb.41.2015.12.09.05.18.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 05:18:47 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Johan Hovold , Alexandre Courbot , Michael Welling , Markus Pargmann Cc: Linus Walleij , Mathias Nyman Subject: [PATCH 043/182] gpio: msic: use gpiochip data pointer Date: Wed, 9 Dec 2015 14:18:44 +0100 Message-Id: <1449667124-31787-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: Mathias Nyman Signed-off-by: Linus Walleij --- drivers/gpio/gpio-msic.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-msic.c b/drivers/gpio/gpio-msic.c index fe9ef2bc981a..fedae58e28f1 100644 --- a/drivers/gpio/gpio-msic.c +++ b/drivers/gpio/gpio-msic.c @@ -179,7 +179,7 @@ static int msic_irq_type(struct irq_data *data, unsigned type) static int msic_gpio_to_irq(struct gpio_chip *chip, unsigned offset) { - struct msic_gpio *mg = container_of(chip, struct msic_gpio, chip); + struct msic_gpio *mg = gpiochip_get_data(chip); return mg->irq_base + offset; } @@ -297,7 +297,7 @@ static int platform_msic_gpio_probe(struct platform_device *pdev) mutex_init(&mg->buslock); - retval = gpiochip_add(&mg->chip); + retval = gpiochip_add_data(&mg->chip, mg); if (retval) { dev_err(dev, "Adding MSIC gpio chip failed\n"); goto err;