From patchwork Wed Dec 9 13:17:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 57991 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp662261lbb; Wed, 9 Dec 2015 05:17:52 -0800 (PST) X-Received: by 10.66.123.72 with SMTP id ly8mr7815322pab.19.1449667071855; Wed, 09 Dec 2015 05:17:51 -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.17.51; Wed, 09 Dec 2015 05:17:51 -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 S1753598AbbLINRv (ORCPT + 4 others); Wed, 9 Dec 2015 08:17:51 -0500 Received: from mail-lb0-f174.google.com ([209.85.217.174]:35757 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752853AbbLINRu (ORCPT ); Wed, 9 Dec 2015 08:17:50 -0500 Received: by lbpu9 with SMTP id u9so29583806lbp.2 for ; Wed, 09 Dec 2015 05:17:49 -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=KQpgX1YU7lsgkegZcmtXG5JI6O5TPULEo/VJO3lwYso=; b=MmE5OHVga6O+l7xWA9zEwHBJ/wYY3y4hMNnwNZUPAiROYhEyMoo1I6OWEjxubShuMB SUTB5wixJnZ85qoEGD01ExSu+rRsvCGGNYhzU11KUQZQk+qIzSAsbWrQNZmagFujHxAN /SENs9lpRGMrl6ec6TZhedHsRIC8Nq8WySXwZ4s0rbZUyMNbYsB5PLX03cN66BL8PmIy 89kEPm7Vsc+IQ65WYxfqX7S65Sa+SVwUpqBVwbtpOpt1Y8y1rJBTedtQpHLf/bBSYV5w iMei3KBUBmbSFZnm1JIGgriVZ+SpsLBT4gPfJdI7kjgqylFyKDOXUG1NmM3HeT5onqI0 JDBw== 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=KQpgX1YU7lsgkegZcmtXG5JI6O5TPULEo/VJO3lwYso=; b=EomhNcQrWvDS03TpfOWEhlkdiJzHz87bAVyPNBE0f+XT7UDG4nmA5OhbIUBI00L78R evzryOi5bfqIPNTv3BAP9SmjHQLABeP54NRDmI91/QzZ93dyr4pQMnqYcC1ygb1jDesW 4IWh0FTShypsyOrdiVz2leP80/w0jrhlKsko3i/73EILpic2yu9I6WfE6N9ihs7fAVht BHZ57lsNgkz8wETafTaxbqx7iK4s08NV7S0ZXIkjh017c/PwwhSryH1LdtHQVPpBpzpu FnU2pW2aTnCtEjR3ppU3SwYNG7KjUFeoxzjsyAUcuZP3XaR7EyCzNuP8e6tf2UibNqsH o3jw== X-Gm-Message-State: ALoCoQlKtBRkOU63rrHRH0lzsO8hYkoESJMfov81TdErP6w8G9acJYD3MBWet0GVyu4sFeOn/LdmjfQJdgW17EWBuS+9vc3QhA== X-Received: by 10.112.134.66 with SMTP id pi2mr2258873lbb.83.1449667069626; Wed, 09 Dec 2015 05:17:49 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id m75sm1436405lfg.15.2015.12.09.05.17.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 05:17:49 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Johan Hovold , Alexandre Courbot , Michael Welling , Markus Pargmann Cc: Linus Walleij Subject: [PATCH 036/182] gpio: mc33880: use gpiochip data pointer Date: Wed, 9 Dec 2015 14:17:46 +0100 Message-Id: <1449667066-31455-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-mc33880.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-mc33880.c b/drivers/gpio/gpio-mc33880.c index b46b9e522e8c..0f0df7956264 100644 --- a/drivers/gpio/gpio-mc33880.c +++ b/drivers/gpio/gpio-mc33880.c @@ -71,7 +71,7 @@ static int __mc33880_set(struct mc33880 *mc, unsigned offset, int value) static void mc33880_set(struct gpio_chip *chip, unsigned offset, int value) { - struct mc33880 *mc = container_of(chip, struct mc33880, chip); + struct mc33880 *mc = gpiochip_get_data(chip); mutex_lock(&mc->lock); @@ -135,7 +135,7 @@ static int mc33880_probe(struct spi_device *spi) goto exit_destroy; } - ret = gpiochip_add(&mc->chip); + ret = gpiochip_add_data(&mc->chip, mc); if (ret) goto exit_destroy;