From patchwork Wed Dec 9 13:34:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 58078 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp672095lbb; Wed, 9 Dec 2015 05:34:38 -0800 (PST) X-Received: by 10.66.254.161 with SMTP id aj1mr7984710pad.31.1449668078067; Wed, 09 Dec 2015 05:34:38 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id nx14si12797123pab.69.2015.12.09.05.34.37; Wed, 09 Dec 2015 05:34:38 -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 S1754193AbbLINeh (ORCPT + 4 others); Wed, 9 Dec 2015 08:34:37 -0500 Received: from mail-lb0-f170.google.com ([209.85.217.170]:34444 "EHLO mail-lb0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751869AbbLINeg (ORCPT ); Wed, 9 Dec 2015 08:34:36 -0500 Received: by lbbcs9 with SMTP id cs9so29999020lbb.1 for ; Wed, 09 Dec 2015 05:34:35 -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=i6OlCj0uzcRM9c1ux0Q4Fc7Fmog5AXG4qmTM1DAHTUE=; b=Y+JORdmoHDY4EQ3FoWnxLymL35bt+OeHPzLHK47XTNVzgTcL6TVw9WwgcADmZdi6m3 kxVUDKSMZVC1eDg7zuO7YmTHUEtFVhylwhthzzqOOPSOAYcGFPDoT0nBdGALoMUYPQ6y EqTPLw8YfgeyNRF5zBZbB1/RuTlx/fA4WCeX3V7XYhk0+LPQRxP9umEP+/Er65MRqSnX zDCDanA7+HusolRcUTg/meEwaTRFCvVQdzfNkuMOOprShkVj0vwSaxIxOwEI2zOh87uy AU8chCyQeZjdRzy2enF70PZzGY7U8Wqpm8WWcYEMBc7Dz0gqCt2kgs63u24xvB88TDje tgOg== 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=i6OlCj0uzcRM9c1ux0Q4Fc7Fmog5AXG4qmTM1DAHTUE=; b=Qm4p3cdPaa+6ByaheMaqxLZtnTU+d1nczeTA3CD5+LBPur4C4ZQUEOCdLe1G++cPmj /w8AZmbj4Igdj91skEHLCtKQLkI3ptROSM48MI0WTCgAHm1UiHOKyt0ezQ6VNpyzBdVm m8DvOgSky50NpUOEFEwrc8RfwEp3cnvHo/XwrXsm49F7Sr+1Q2pfBKMtH6aW7YppZ/UJ z6xqWWRzHqCOQeXcDMUabXBmf3q8HJpredkd/X3xwuEBpnH/IjCtrMbLtvBAjZNPNao7 zLnp5Cfh+PlgpNz0M6w+lIkGiOko3hIKk9Pd4Lx9n9ZOqGVCzFFLdUwYwDYGxz7D8PkP MS4w== X-Gm-Message-State: ALoCoQkf6KYU19HKC82CWU++3AOD9YvNkqFwuPwsSil6fior9I+nt+YeNbMtmduzYROJYddz5N5+V7Cf6RhrU4ETUzm9B2ikXA== X-Received: by 10.112.138.38 with SMTP id qn6mr2396720lbb.29.1449668075574; Wed, 09 Dec 2015 05:34:35 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id qp7sm1441954lbc.24.2015.12.09.05.34.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 05:34:34 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Johan Hovold , Alexandre Courbot , Michael Welling , Markus Pargmann Cc: Linus Walleij , Heiko Stuebner Subject: [PATCH 122/182] pinctrl: vt8500-wmt: use gpiochip data pointer Date: Wed, 9 Dec 2015 14:34:32 +0100 Message-Id: <1449668072-3579-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: Heiko Stuebner Signed-off-by: Linus Walleij --- drivers/pinctrl/vt8500/pinctrl-wmt.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/vt8500/pinctrl-wmt.c b/drivers/pinctrl/vt8500/pinctrl-wmt.c index e9c1dfd90570..5c261bf5542f 100644 --- a/drivers/pinctrl/vt8500/pinctrl-wmt.c +++ b/drivers/pinctrl/vt8500/pinctrl-wmt.c @@ -14,7 +14,7 @@ */ #include -#include +#include #include #include #include @@ -488,7 +488,7 @@ static struct pinctrl_desc wmt_desc = { static int wmt_gpio_get_direction(struct gpio_chip *chip, unsigned offset) { - struct wmt_pinctrl_data *data = dev_get_drvdata(chip->parent); + struct wmt_pinctrl_data *data = gpiochip_get_data(chip); u32 bank = WMT_BANK_FROM_PIN(offset); u32 bit = WMT_BIT_FROM_PIN(offset); u32 reg_dir = data->banks[bank].reg_dir; @@ -503,7 +503,7 @@ static int wmt_gpio_get_direction(struct gpio_chip *chip, unsigned offset) static int wmt_gpio_get_value(struct gpio_chip *chip, unsigned offset) { - struct wmt_pinctrl_data *data = dev_get_drvdata(chip->parent); + struct wmt_pinctrl_data *data = gpiochip_get_data(chip); u32 bank = WMT_BANK_FROM_PIN(offset); u32 bit = WMT_BIT_FROM_PIN(offset); u32 reg_data_in = data->banks[bank].reg_data_in; @@ -519,7 +519,7 @@ static int wmt_gpio_get_value(struct gpio_chip *chip, unsigned offset) static void wmt_gpio_set_value(struct gpio_chip *chip, unsigned offset, int val) { - struct wmt_pinctrl_data *data = dev_get_drvdata(chip->parent); + struct wmt_pinctrl_data *data = gpiochip_get_data(chip); u32 bank = WMT_BANK_FROM_PIN(offset); u32 bit = WMT_BIT_FROM_PIN(offset); u32 reg_data_out = data->banks[bank].reg_data_out; @@ -589,7 +589,7 @@ int wmt_pinctrl_probe(struct platform_device *pdev, return PTR_ERR(data->pctl_dev); } - err = gpiochip_add(&data->gpio_chip); + err = gpiochip_add_data(&data->gpio_chip, data); if (err) { dev_err(&pdev->dev, "could not add GPIO chip\n"); goto fail_gpio;