From patchwork Wed Dec 9 13:27:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 58031 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp667741lbb; Wed, 9 Dec 2015 05:27:24 -0800 (PST) X-Received: by 10.66.236.229 with SMTP id ux5mr6354864pac.91.1449667644093; Wed, 09 Dec 2015 05:27:24 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 81si12789743pfr.79.2015.12.09.05.27.23; Wed, 09 Dec 2015 05:27:24 -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 S1754166AbbLIN1V (ORCPT + 4 others); Wed, 9 Dec 2015 08:27:21 -0500 Received: from mail-lf0-f53.google.com ([209.85.215.53]:32892 "EHLO mail-lf0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754327AbbLIN1U (ORCPT ); Wed, 9 Dec 2015 08:27:20 -0500 Received: by lfaz4 with SMTP id z4so34195263lfa.0 for ; Wed, 09 Dec 2015 05:27:18 -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=g7d5aV/n+mXxWIOZyUruGP0AQ4WnGtrBwYuw9w4PqpY=; b=miKj5KZ0ywahirfAjEMVyOEqrdbzwRNNCnsR1akEelCSmHtEX39rL1CPLPjqShKdZ2 hPzXwATOvNgThxMxDhXN16Dc13KgLJioYtZQ0eYWWNPnZSstJUV1RqyMtLrSFpzopbna kn+SIiSfml0iFYkymdgXPTMaSMqg1oGdy2XFNgsDsGbhKGLTpjAyy2kdHBsy0bfaY8ng zxZplceauUj7tFZJaoMub6WwtBbgvWx6uZgjT5TCSuCQXF0ltMiacSSAtcEDImwjJyI/ Ztf4ltUwl7YnzBbSQpyxeSclbGb0kJj62JMzBdjGxWjtrC+fBfDiIDl7LZ+fwp8/8XKO WSIw== 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=g7d5aV/n+mXxWIOZyUruGP0AQ4WnGtrBwYuw9w4PqpY=; b=CumDi4qqWg9nuPVHMhapp99jRitdbddxjyWr/ow1/Cc3SZd36BARywrbI0vzEQAYvS 89fCWm+FLTbcaBLRyJjKbJ6eX3NUx9NZt35oZz4WO9e5i4zRNts+SjzVzGzKm/ARrQMI QdAjkKM6sCwdFMupGF/7flf0+qb+/eTMN/Vov8dFzNJ2kQCGcANiuyP43Uw7sHoNbM6K TKGvDfiL1gw1l8tD92XxeotbUXEmCz86umvmhiNHLN2xhGiG298tcawUBIBJH2YMljmJ RG1gIDBU57kJMOkBLBtYHomYYwofQJ6quhJ7IAReRXKzPk6MhegQNzAlikBPUQEQBYpW M6+A== X-Gm-Message-State: ALoCoQlm+vLTwXJdImb3z3ba25G5ujJF1rLXH2pXMlKhvZqFU2mGQIM6Monq+C/vxFjcmtLLo6w40LKT+5aj1+iLFsALs1uqkw== X-Received: by 10.25.218.9 with SMTP id r9mr2267913lfg.138.1449667638779; Wed, 09 Dec 2015 05:27:18 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id i7sm1438343lbo.39.2015.12.09.05.27.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 05:27:18 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Johan Hovold , Alexandre Courbot , Michael Welling , Markus Pargmann Cc: Linus Walleij Subject: [PATCH 075/182] gpio: ucb1400: use gpiochip data pointer Date: Wed, 9 Dec 2015 14:27:15 +0100 Message-Id: <1449667635-968-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-ucb1400.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 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-ucb1400.c b/drivers/gpio/gpio-ucb1400.c index d502825159b9..3e719c213696 100644 --- a/drivers/gpio/gpio-ucb1400.c +++ b/drivers/gpio/gpio-ucb1400.c @@ -15,7 +15,7 @@ static int ucb1400_gpio_dir_in(struct gpio_chip *gc, unsigned off) { struct ucb1400_gpio *gpio; - gpio = container_of(gc, struct ucb1400_gpio, gc); + gpio = gpiochip_get_data(gc); ucb1400_gpio_set_direction(gpio->ac97, off, 0); return 0; } @@ -23,7 +23,7 @@ static int ucb1400_gpio_dir_in(struct gpio_chip *gc, unsigned off) static int ucb1400_gpio_dir_out(struct gpio_chip *gc, unsigned off, int val) { struct ucb1400_gpio *gpio; - gpio = container_of(gc, struct ucb1400_gpio, gc); + gpio = gpiochip_get_data(gc); ucb1400_gpio_set_direction(gpio->ac97, off, 1); ucb1400_gpio_set_value(gpio->ac97, off, val); return 0; @@ -32,14 +32,14 @@ static int ucb1400_gpio_dir_out(struct gpio_chip *gc, unsigned off, int val) static int ucb1400_gpio_get(struct gpio_chip *gc, unsigned off) { struct ucb1400_gpio *gpio; - gpio = container_of(gc, struct ucb1400_gpio, gc); + gpio = gpiochip_get_data(gc); return ucb1400_gpio_get_value(gpio->ac97, off); } static void ucb1400_gpio_set(struct gpio_chip *gc, unsigned off, int val) { struct ucb1400_gpio *gpio; - gpio = container_of(gc, struct ucb1400_gpio, gc); + gpio = gpiochip_get_data(gc); ucb1400_gpio_set_value(gpio->ac97, off, val); } @@ -66,7 +66,7 @@ static int ucb1400_gpio_probe(struct platform_device *dev) ucb->gc.set = ucb1400_gpio_set; ucb->gc.can_sleep = true; - err = gpiochip_add(&ucb->gc); + err = gpiochip_add_data(&ucb->gc, ucb); if (err) goto err;