From patchwork Wed Dec 9 13:33:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 58069 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp671330lbb; Wed, 9 Dec 2015 05:33:25 -0800 (PST) X-Received: by 10.98.68.83 with SMTP id r80mr12782389pfa.120.1449668004987; Wed, 09 Dec 2015 05:33:24 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t6si12782315pfa.123.2015.12.09.05.33.24; Wed, 09 Dec 2015 05:33: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 S1754467AbbLINdY (ORCPT + 4 others); Wed, 9 Dec 2015 08:33:24 -0500 Received: from mail-lb0-f181.google.com ([209.85.217.181]:33673 "EHLO mail-lb0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754451AbbLINdX (ORCPT ); Wed, 9 Dec 2015 08:33:23 -0500 Received: by lbbkw15 with SMTP id kw15so30058776lbb.0 for ; Wed, 09 Dec 2015 05:33:22 -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=+R7Zl/ufuiXxCjLKgnIjoq4tYXkKmDGqFmSXoyXK6cc=; b=ta9WYRQkKcEm9+m6XdKeAPxic0dAchjVMWdXcfn0eh4R7fQr9Jdc8hfqNmN4weLblI 3HMVo9l1C3/SbshmbtnolDXxnWBcbs3vpwdLxSWdWz03/akaQ2zmcpeaA+vIrRtfuLa9 OkvlK2zugidEMmeJF348wzqhUTA2OQVAHDqmGqPh/+1KK9kmsbUspAx3HG/aOJ1g1YRi w87YQyVLVfY2BfbXhRnB8E1nFeFPoWsOBFewPdbqHtRcFzwAriy6XABN5OHgRuJnaIDg DcyB4rFUHq3UkS4zNkpfQT1pCa2ye6LD+VaNG0lWO/8eAXQjLmMLoPu9Hswpl0S/mLwm WLLg== 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=+R7Zl/ufuiXxCjLKgnIjoq4tYXkKmDGqFmSXoyXK6cc=; b=h7SKr/HMT4MrO0wYg8jVLGty3sGVmkRSAd1PrA6nC/wXC1VG0ABPvkEP98ci3HwOq0 U3UyTo86fEn8CEBchvRJ5Wv484NWdwWHRWWJhGvzZgApU2OPC2eVV/s31BoGFKKrx2Zv sw3FpA4AMFQkYZsdicM5LTl/T4YgFuUZ9H9wULg9+0/DonfBxpXLAdRx8C0JmxYECwgK R9ibTcTvAso/dcDr0kK/8j8z937NSeA+FxbubohyOQ12kIy8W15vmZQrYvZDAk7gaF88 THEuPOLSyke0oK+Ufqsy44tGktXg9xqubi9AVIaTGcc+mFtUBks9He/yZzizqOw+slUw 5few== X-Gm-Message-State: ALoCoQmVGwP6ZE0Qo8FbmGXP/Dhm315SEfO7uEKgRbpeNXkYqoHAkZW1wnCvqLJXyl8po5Z4fWej77G9CTCLEqTsprwiiPUyvg== X-Received: by 10.112.128.199 with SMTP id nq7mr2424927lbb.42.1449668002443; Wed, 09 Dec 2015 05:33:22 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id o67sm1432921lfo.33.2015.12.09.05.33.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 05:33:21 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Johan Hovold , Alexandre Courbot , Michael Welling , Markus Pargmann Cc: Linus Walleij , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH 113/182] pinctrl: sunxi: use gpiochip data pointer Date: Wed, 9 Dec 2015 14:33:19 +0100 Message-Id: <1449667999-3152-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: Maxime Ripard Cc: Chen-Yu Tsai Signed-off-by: Linus Walleij --- drivers/pinctrl/sunxi/pinctrl-sunxi.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/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c index a437e4f8628b..a1b672cbb8e0 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include #include @@ -454,7 +454,7 @@ static int sunxi_pinctrl_gpio_direction_input(struct gpio_chip *chip, static int sunxi_pinctrl_gpio_get(struct gpio_chip *chip, unsigned offset) { - struct sunxi_pinctrl *pctl = dev_get_drvdata(chip->parent); + struct sunxi_pinctrl *pctl = gpiochip_get_data(chip); u32 reg = sunxi_data_reg(offset); u8 index = sunxi_data_offset(offset); u32 set_mux = pctl->desc->irq_read_needs_mux && @@ -475,7 +475,7 @@ static int sunxi_pinctrl_gpio_get(struct gpio_chip *chip, unsigned offset) static void sunxi_pinctrl_gpio_set(struct gpio_chip *chip, unsigned offset, int value) { - struct sunxi_pinctrl *pctl = dev_get_drvdata(chip->parent); + struct sunxi_pinctrl *pctl = gpiochip_get_data(chip); u32 reg = sunxi_data_reg(offset); u8 index = sunxi_data_offset(offset); unsigned long flags; @@ -522,7 +522,7 @@ static int sunxi_pinctrl_gpio_of_xlate(struct gpio_chip *gc, static int sunxi_pinctrl_gpio_to_irq(struct gpio_chip *chip, unsigned offset) { - struct sunxi_pinctrl *pctl = dev_get_drvdata(chip->parent); + struct sunxi_pinctrl *pctl = gpiochip_get_data(chip); struct sunxi_desc_function *desc; unsigned pinnum = pctl->desc->pin_base + offset; unsigned irqnum; @@ -962,7 +962,7 @@ int sunxi_pinctrl_init(struct platform_device *pdev, pctl->chip->parent = &pdev->dev; pctl->chip->base = pctl->desc->pin_base; - ret = gpiochip_add(pctl->chip); + ret = gpiochip_add_data(pctl->chip, pctl); if (ret) goto pinctrl_error;