From patchwork Wed Dec 9 13:15:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 57972 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp660566lbb; Wed, 9 Dec 2015 05:15:10 -0800 (PST) X-Received: by 10.66.141.12 with SMTP id rk12mr7890241pab.32.1449666910173; Wed, 09 Dec 2015 05:15:10 -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.15.09; Wed, 09 Dec 2015 05:15:10 -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 S1751310AbbLINPJ (ORCPT + 4 others); Wed, 9 Dec 2015 08:15:09 -0500 Received: from mail-lf0-f52.google.com ([209.85.215.52]:35615 "EHLO mail-lf0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753592AbbLINPI (ORCPT ); Wed, 9 Dec 2015 08:15:08 -0500 Received: by lfdl133 with SMTP id l133so33786307lfd.2 for ; Wed, 09 Dec 2015 05:15:06 -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=cpv6mkX+R7Dyat5isqaYZzoYv0fjt8Z0/7mDFlxUvuo=; b=GnUHB3qNHmbRFH5xsjzb4/V0T8l4YogOqrT5vU41CfL8HQBvLnNBeZwczcpKG0rIfe RfzIKllRl+QjXIcuaoVUAukoXuN2uEVTsXMYvdaYR09IKbdkazIuWkySdn5IPFq1eiBf qjwttX99WwiguoKRfnsVqIGh9t2RV36DCxRKbTS6cRsikuYRuW6B9PJwDD5oyiUELxEg C/L1iugkip5mU9XvMNU0zPOpFOBZdwQRK4g3C3nAsIRyJ9EcEaO041ET20hR1rpjoffx qoqFqMaZNDGFYTZWDkhpnMR/W/2wpgh2Crqe2pCMV7jihBXmZUBs0wxLbxPNGtsGKF/F PBbw== 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=cpv6mkX+R7Dyat5isqaYZzoYv0fjt8Z0/7mDFlxUvuo=; b=fIjrKrG6mzYEh/Tn4lui7LvN3v5ORaGngIaglI13KBqZ/KtKCUbwZQdE1kvDl0OEeC //dwyD0ILESkUPdi5FT8K2AnxknmWSil6F4Quz2feUyt0kydJJ+LKMukX1rRMUg5PXI7 mBP70i3GGjCWjOxhlcg4B/lWc/7g+P0pI6DY7ffgfD0ZVFQOJCMEisqHKRA3CWtQ/50H Ik7IJtW167yhAh99+Y6tUpYRM+3YBx68V8kjjnqkXnntT4XYddtMKVrPqG7XEgEiEybY ESJqDB+kdIn6HZJgtDwF+zvHMIEeGX/UqdRUKeHu4xi/A10WWd87NiJH2SKcDLbl/1Pe cbhw== X-Gm-Message-State: ALoCoQn6ukbJ2VeGQ4OzXEXjNASVi5Wtgl2M567UpnGo/U96J2H1IQa+EhKbVPQRiHGopgNrEPDjVlUrScbys+4HJJnlh+mI5A== X-Received: by 10.25.169.212 with SMTP id s203mr1811951lfe.134.1449666906840; Wed, 09 Dec 2015 05:15:06 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id px9sm1412028lbb.4.2015.12.09.05.15.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 05:15:06 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Johan Hovold , Alexandre Courbot , Michael Welling , Markus Pargmann Cc: Linus Walleij , Michael Buesch Subject: [PATCH 017/182] gpio: bt8xx: use gpiochip data pointer Date: Wed, 9 Dec 2015 14:15:03 +0100 Message-Id: <1449666903-30548-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: Michael Buesch Signed-off-by: Linus Walleij --- drivers/gpio/gpio-bt8xx.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-bt8xx.c b/drivers/gpio/gpio-bt8xx.c index 7e4c43c18960..acefb25e8eca 100644 --- a/drivers/gpio/gpio-bt8xx.c +++ b/drivers/gpio/gpio-bt8xx.c @@ -80,7 +80,7 @@ MODULE_PARM_DESC(gpiobase, "The GPIO number base. -1 means dynamic, which is the static int bt8xxgpio_gpio_direction_input(struct gpio_chip *gpio, unsigned nr) { - struct bt8xxgpio *bg = container_of(gpio, struct bt8xxgpio, gpio); + struct bt8xxgpio *bg = gpiochip_get_data(gpio); unsigned long flags; u32 outen, data; @@ -101,7 +101,7 @@ static int bt8xxgpio_gpio_direction_input(struct gpio_chip *gpio, unsigned nr) static int bt8xxgpio_gpio_get(struct gpio_chip *gpio, unsigned nr) { - struct bt8xxgpio *bg = container_of(gpio, struct bt8xxgpio, gpio); + struct bt8xxgpio *bg = gpiochip_get_data(gpio); unsigned long flags; u32 val; @@ -115,7 +115,7 @@ static int bt8xxgpio_gpio_get(struct gpio_chip *gpio, unsigned nr) static int bt8xxgpio_gpio_direction_output(struct gpio_chip *gpio, unsigned nr, int val) { - struct bt8xxgpio *bg = container_of(gpio, struct bt8xxgpio, gpio); + struct bt8xxgpio *bg = gpiochip_get_data(gpio); unsigned long flags; u32 outen, data; @@ -140,7 +140,7 @@ static int bt8xxgpio_gpio_direction_output(struct gpio_chip *gpio, static void bt8xxgpio_gpio_set(struct gpio_chip *gpio, unsigned nr, int val) { - struct bt8xxgpio *bg = container_of(gpio, struct bt8xxgpio, gpio); + struct bt8xxgpio *bg = gpiochip_get_data(gpio); unsigned long flags; u32 data; @@ -217,7 +217,7 @@ static int bt8xxgpio_probe(struct pci_dev *dev, bgwrite(0, BT848_GPIO_OUT_EN); bt8xxgpio_gpio_setup(bg); - err = gpiochip_add(&bg->gpio); + err = gpiochip_add_data(&bg->gpio, bg); if (err) { printk(KERN_ERR "bt8xxgpio: Failed to register GPIOs\n"); goto err_disable;