From patchwork Wed Dec 9 13:32:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 58059 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp670524lbb; Wed, 9 Dec 2015 05:32:08 -0800 (PST) X-Received: by 10.66.65.109 with SMTP id w13mr7852210pas.142.1449667928327; Wed, 09 Dec 2015 05:32:08 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f18si12793619pfj.115.2015.12.09.05.32.08; Wed, 09 Dec 2015 05:32: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 S1754298AbbLINcH (ORCPT + 4 others); Wed, 9 Dec 2015 08:32:07 -0500 Received: from mail-lb0-f170.google.com ([209.85.217.170]:35279 "EHLO mail-lb0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754181AbbLINcG (ORCPT ); Wed, 9 Dec 2015 08:32:06 -0500 Received: by lbpu9 with SMTP id u9so29824300lbp.2 for ; Wed, 09 Dec 2015 05:32: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=mjaODE5wlc7IIsOszKic+2HUamO8zyF1l3cWl4iivmM=; b=nno+xsw06OCwc8kr9ZMa91qHDzo0+4sR+ulMXGh9Sl9qHTXnsY2IQt9l2SqUCQFj6q lzwkr69TkbiAtJWLAlZLtCDoc4YiaGc671Km7Y/xioYiDRz9qhpp/z54kQcz06DIEmoh 0ElNUjvOGpZ3wkP85w25q5BqdYzX10MrooWCvHaPx1TWzCWCSgiKK17WrVo8jmxzbD7d AidK7t7yT2Ad6Vxb6I0K0dmrhuAVyhztspYNo9QUKXFBby0dUeeXMQd9Qcng8A0yEWmc kZPzFhURiaH5n7Byir9XeJsM9KeNbOwHt4IrvSep5rZQEjSm6RD7+D8uLcYxPvmBquPl WfrA== 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=mjaODE5wlc7IIsOszKic+2HUamO8zyF1l3cWl4iivmM=; b=c0KwR1CfaC7GVkswbva71GsMlDTyzqsUkrMx++gGOH704WvgEeNVUxLq9V3rd9b/8V vkSaqdURi4zOIISGBwZRI+7kNJKTK98QYped8NccoaDu2/cWtXnQ7E3Y8hkbF82rtv3C zNdfs6XYq9U52dZTuQ6b7ZuWFNbeshdvZ3UaOeSdp+b18beog+vBc5wTik3whcEq/JCI q1EzFoWmUb5kvvJvFjDOYsQIrvGMeO8waJ1EVT1CFRZyhs+wocjmMAr7C0h8lrK3yHyh wYKxFRj9IkPzup118gPYypj5VqvB6z49YXOzcXaRfBiAnBeTXucLe+ym/HOsWfuGXGgs F+DQ== X-Gm-Message-State: ALoCoQka3flV6yRrUtKN56Z4JcBKNESTFSaee3vWIV6Y3+Dr0oNnxbcGWqjD6lR9BWGRGc40EhWm+jDxP/nsiitJo50wagriNQ== X-Received: by 10.112.170.67 with SMTP id ak3mr2425067lbc.82.1449667924758; Wed, 09 Dec 2015 05:32:04 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id sv10sm1401240lbb.46.2015.12.09.05.32.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 05:32:04 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Johan Hovold , Alexandre Courbot , Michael Welling , Markus Pargmann Cc: Linus Walleij , Baruch Siach Subject: [PATCH 103/182] pinctrl: digicolor: use gpiochip data pointer Date: Wed, 9 Dec 2015 14:32:01 +0100 Message-Id: <1449667921-2612-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: Baruch Siach Signed-off-by: Linus Walleij --- drivers/pinctrl/pinctrl-digicolor.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/pinctrl/pinctrl-digicolor.c b/drivers/pinctrl/pinctrl-digicolor.c index d8efb2ccac6c..f1343d6ca823 100644 --- a/drivers/pinctrl/pinctrl-digicolor.c +++ b/drivers/pinctrl/pinctrl-digicolor.c @@ -171,7 +171,7 @@ static struct pinmux_ops dc_pmxops = { static int dc_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) { - struct dc_pinmap *pmap = container_of(chip, struct dc_pinmap, chip); + struct dc_pinmap *pmap = gpiochip_get_data(chip); int reg_off = GP_DRIVE0(gpio/PINS_PER_COLLECTION); int bit_off = gpio % PINS_PER_COLLECTION; u8 drive; @@ -191,7 +191,7 @@ static void dc_gpio_set(struct gpio_chip *chip, unsigned gpio, int value); static int dc_gpio_direction_output(struct gpio_chip *chip, unsigned gpio, int value) { - struct dc_pinmap *pmap = container_of(chip, struct dc_pinmap, chip); + struct dc_pinmap *pmap = gpiochip_get_data(chip); int reg_off = GP_DRIVE0(gpio/PINS_PER_COLLECTION); int bit_off = gpio % PINS_PER_COLLECTION; u8 drive; @@ -210,7 +210,7 @@ static int dc_gpio_direction_output(struct gpio_chip *chip, unsigned gpio, static int dc_gpio_get(struct gpio_chip *chip, unsigned gpio) { - struct dc_pinmap *pmap = container_of(chip, struct dc_pinmap, chip); + struct dc_pinmap *pmap = gpiochip_get_data(chip); int reg_off = GP_INPUT(gpio/PINS_PER_COLLECTION); int bit_off = gpio % PINS_PER_COLLECTION; u8 input; @@ -222,7 +222,7 @@ static int dc_gpio_get(struct gpio_chip *chip, unsigned gpio) static void dc_gpio_set(struct gpio_chip *chip, unsigned gpio, int value) { - struct dc_pinmap *pmap = container_of(chip, struct dc_pinmap, chip); + struct dc_pinmap *pmap = gpiochip_get_data(chip); int reg_off = GP_OUTPUT0(gpio/PINS_PER_COLLECTION); int bit_off = gpio % PINS_PER_COLLECTION; u8 output; @@ -258,7 +258,7 @@ static int dc_gpiochip_add(struct dc_pinmap *pmap, struct device_node *np) spin_lock_init(&pmap->lock); - ret = gpiochip_add(chip); + ret = gpiochip_add_data(chip, pmap); if (ret < 0) return ret;