From patchwork Wed Dec 9 13:33:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 58067 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp671184lbb; Wed, 9 Dec 2015 05:33:11 -0800 (PST) X-Received: by 10.67.24.104 with SMTP id ih8mr8009438pad.124.1449667991291; Wed, 09 Dec 2015 05:33:11 -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.11; Wed, 09 Dec 2015 05:33:11 -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 S1754416AbbLINdK (ORCPT + 4 others); Wed, 9 Dec 2015 08:33:10 -0500 Received: from mail-lf0-f41.google.com ([209.85.215.41]:33028 "EHLO mail-lf0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751883AbbLINdJ (ORCPT ); Wed, 9 Dec 2015 08:33:09 -0500 Received: by lfaz4 with SMTP id z4so34310629lfa.0 for ; Wed, 09 Dec 2015 05:33:08 -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:mime-version:content-type :content-transfer-encoding; bh=TYvM+3Z6eyLXTKcpk3hsyyAFPIxhHn5HHUg0F6K/3Ko=; b=cpJy27OswJa5VbvpIEEuqNTQA9onSuppEgD0HB2oKfZcEh96fE/LPZKBYkpKDF/cIz B3hlsx8MeJCE/Vgf0DoTkmY4yN7CiqaMX+L6AuGNy/bqXqmaZp5CjRppvAI2AbL1/UjI gfmztN4WtRgZdDKLlr3jU1Zx6vUqqxLzknGCCRR3gI7Tz4FgRZB8wOtKVK8ymcvfYRcu FJGtGoX0JLkGBi1pMxQuJFYeqekANLMrPUDSmiEDi9kBi7+6407O/Dy5byAJXvRTThKO pWCtw3N+s1AcFhyrh6rH+u+I7lqT1n2hRd/IM+IiXmM11E+x9ZruemXWZvs0AkS+Y0Tz ch+w== 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:mime-version :content-type:content-transfer-encoding; bh=TYvM+3Z6eyLXTKcpk3hsyyAFPIxhHn5HHUg0F6K/3Ko=; b=KNSs8VtEpWoKtlbWj25nZMzMHV0c+uK8LycVKoiSe5OqMeG7v93fHeixABX/XD64rY xooer3BZMOAFJo2lX0mReA9oQdilQ0Jjn83zR3pumfeNbsfGZIBUUbLqBD/zvcWTbUtK Xw+f8o+BdSFznx7RjvTDwWEP7q02ELWMo1Qsbd13rslMelu7Tp6/E34M8Pk79pcTwSvs XqoysYgfKwGFfofWNGsayLDIW/oNhMCJm92kuALphdap2I4/lpQ9WXsRL3s5XV1VUeOB fCK5MJCNPqnO8pwieKleJn1nHwR8FNJU32E+PKVR59IWY1sj711oMaGKnBNm5ugvR8AR V00w== X-Gm-Message-State: ALoCoQnr5Lp1Ka3kJSro6kXiD3Qw/U+mlnvTuHaflc3SAW6U9hH9riKnPn0Ra2PGwPmz+/Cvnc3oYrAhl4s45qCYQb/T6jkApg== X-Received: by 10.25.155.207 with SMTP id d198mr2386187lfe.93.1449667988201; Wed, 09 Dec 2015 05:33:08 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id g80sm1451014lfg.44.2015.12.09.05.33.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 05:33:07 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Johan Hovold , Alexandre Courbot , Michael Welling , Markus Pargmann Cc: Linus Walleij , =?UTF-8?q?Bj=C3=B6rn=20Andersson?= Subject: [PATCH 111/182] pinctrl: ssbi-gpio: use gpiochip data pointer Date: Wed, 9 Dec 2015 14:33:04 +0100 Message-Id: <1449667984-3057-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 MIME-Version: 1.0 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: Björn Andersson Signed-off-by: Linus Walleij --- drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 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/qcom/pinctrl-ssbi-gpio.c b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c index 7b80fa9c2049..d91572160a0e 100644 --- a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c @@ -443,7 +443,7 @@ static struct pinctrl_desc pm8xxx_pinctrl_desc = { static int pm8xxx_gpio_direction_input(struct gpio_chip *chip, unsigned offset) { - struct pm8xxx_gpio *pctrl = container_of(chip, struct pm8xxx_gpio, chip); + struct pm8xxx_gpio *pctrl = gpiochip_get_data(chip); struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; u8 val; @@ -459,7 +459,7 @@ static int pm8xxx_gpio_direction_output(struct gpio_chip *chip, unsigned offset, int value) { - struct pm8xxx_gpio *pctrl = container_of(chip, struct pm8xxx_gpio, chip); + struct pm8xxx_gpio *pctrl = gpiochip_get_data(chip); struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; u8 val; @@ -477,7 +477,7 @@ static int pm8xxx_gpio_direction_output(struct gpio_chip *chip, static int pm8xxx_gpio_get(struct gpio_chip *chip, unsigned offset) { - struct pm8xxx_gpio *pctrl = container_of(chip, struct pm8xxx_gpio, chip); + struct pm8xxx_gpio *pctrl = gpiochip_get_data(chip); struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; bool state; int ret; @@ -495,7 +495,7 @@ static int pm8xxx_gpio_get(struct gpio_chip *chip, unsigned offset) static void pm8xxx_gpio_set(struct gpio_chip *chip, unsigned offset, int value) { - struct pm8xxx_gpio *pctrl = container_of(chip, struct pm8xxx_gpio, chip); + struct pm8xxx_gpio *pctrl = gpiochip_get_data(chip); struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; u8 val; @@ -524,7 +524,7 @@ static int pm8xxx_gpio_of_xlate(struct gpio_chip *chip, static int pm8xxx_gpio_to_irq(struct gpio_chip *chip, unsigned offset) { - struct pm8xxx_gpio *pctrl = container_of(chip, struct pm8xxx_gpio, chip); + struct pm8xxx_gpio *pctrl = gpiochip_get_data(chip); struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; return pin->irq; @@ -539,7 +539,7 @@ static void pm8xxx_gpio_dbg_show_one(struct seq_file *s, unsigned offset, unsigned gpio) { - struct pm8xxx_gpio *pctrl = container_of(chip, struct pm8xxx_gpio, chip); + struct pm8xxx_gpio *pctrl = gpiochip_get_data(chip); struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; static const char * const modes[] = { @@ -735,7 +735,7 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev) pctrl->chip.of_gpio_n_cells = 2; pctrl->chip.label = dev_name(pctrl->dev); pctrl->chip.ngpio = pctrl->npins; - ret = gpiochip_add(&pctrl->chip); + ret = gpiochip_add_data(&pctrl->chip, pctrl); if (ret) { dev_err(&pdev->dev, "failed register gpiochip\n"); goto unregister_pinctrl;