From patchwork Wed Dec 9 13:32:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 58066 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp671114lbb; Wed, 9 Dec 2015 05:33:04 -0800 (PST) X-Received: by 10.98.16.76 with SMTP id y73mr12766435pfi.151.1449667984033; Wed, 09 Dec 2015 05:33:04 -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.03; Wed, 09 Dec 2015 05:33:04 -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 S1754299AbbLINdD (ORCPT + 4 others); Wed, 9 Dec 2015 08:33:03 -0500 Received: from mail-lb0-f176.google.com ([209.85.217.176]:33488 "EHLO mail-lb0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753962AbbLINdB (ORCPT ); Wed, 9 Dec 2015 08:33:01 -0500 Received: by lbbkw15 with SMTP id kw15so30052334lbb.0 for ; Wed, 09 Dec 2015 05:33:00 -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=0Wr9OyRcvguvdgORBtjTj05zvKtXx53D1DSneSVuUtU=; b=P1XOCsEJwgdLokj1o1IHTrB1JvBjcn2sLp0dHpqwvNLaPfvRSo78Ib6KYORjm1WHGs kfaZmfCZnH6xZRstoQ0R1H99bRWBYlJ14TiBcXGnQ222L5kVAXTLMhEpl28R6LMHKgDE /WeLBfmRNtJMCbuV5HLgTSP7JV+AtPr7Q9q0LNq6SnGg+4j2N8e9KjUPEUlljwx5mV6w H4Rkw09567EcGCRnnzp1OpQtJ9AkZKKgJE3qtGaKImj3iMsYfhQz+jowZvxnLgjc3VFC K2jw5E1FlFmVV1s8tH7LqLZVNgbbh6G00ZVhk68haL2gxqJqMIRSCnPSRL0Y1YheaD1k x7/g== 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=0Wr9OyRcvguvdgORBtjTj05zvKtXx53D1DSneSVuUtU=; b=B9RXaje791e2Gk+jX+PxNn1ABXITlybfgJYuRGooqbgso5f2KUgJeXvBvhm9sTbdIK jORb3/B8VKhfSIjjwUIo2Jr+vQTVIo8vdgXaWdy4FX+4OX71R1xbAvXvRF6xwjDo2ol1 hj/+u8RvWiTc/ZTclDSKVpbg5K93IkkkxS/pumReJqIPevax8B7MuYnxb+fAztIrrCgl Z1wFgCjQXjRLZUJ5Uup/HjwXSMCvxuGM1Vzbd3YjLebJCh6UFsTwDX2aghMFpSV+Fdck +LHfvvsYJACRhNCjUCm1lnvqGWELSNEWz+CsTCkjEqQEmZN5rFHZpEpER1udL9Jc+N/Q CWzw== X-Gm-Message-State: ALoCoQlOgQOiuYYBxaWsYhpxk9aKT/7i9n3STX0uUbVMP1Qco/CyAhYzV8gE4V02a/1Cy3a61LQLte0YvL+Aqb7A4fsSEgdWAg== X-Received: by 10.112.146.234 with SMTP id tf10mr2361500lbb.45.1449667980330; Wed, 09 Dec 2015 05:33:00 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id r2sm1417117lfe.28.2015.12.09.05.32.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 05:32:59 -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 110/182] pinctrl: ssbi-mpp: use gpiochip data pointer Date: Wed, 9 Dec 2015 14:32:57 +0100 Message-Id: <1449667977-3010-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-mpp.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-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c index 7bc1e0f27447..9b8de2da2451 100644 --- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c @@ -448,7 +448,7 @@ static struct pinctrl_desc pm8xxx_pinctrl_desc = { static int pm8xxx_mpp_direction_input(struct gpio_chip *chip, unsigned offset) { - struct pm8xxx_mpp *pctrl = container_of(chip, struct pm8xxx_mpp, chip); + struct pm8xxx_mpp *pctrl = gpiochip_get_data(chip); struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; switch (pin->mode) { @@ -472,7 +472,7 @@ static int pm8xxx_mpp_direction_output(struct gpio_chip *chip, unsigned offset, int value) { - struct pm8xxx_mpp *pctrl = container_of(chip, struct pm8xxx_mpp, chip); + struct pm8xxx_mpp *pctrl = gpiochip_get_data(chip); struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; switch (pin->mode) { @@ -496,7 +496,7 @@ static int pm8xxx_mpp_direction_output(struct gpio_chip *chip, static int pm8xxx_mpp_get(struct gpio_chip *chip, unsigned offset) { - struct pm8xxx_mpp *pctrl = container_of(chip, struct pm8xxx_mpp, chip); + struct pm8xxx_mpp *pctrl = gpiochip_get_data(chip); struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; bool state; int ret; @@ -513,7 +513,7 @@ static int pm8xxx_mpp_get(struct gpio_chip *chip, unsigned offset) static void pm8xxx_mpp_set(struct gpio_chip *chip, unsigned offset, int value) { - struct pm8xxx_mpp *pctrl = container_of(chip, struct pm8xxx_mpp, chip); + struct pm8xxx_mpp *pctrl = gpiochip_get_data(chip); struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; pin->output_value = !!value; @@ -537,7 +537,7 @@ static int pm8xxx_mpp_of_xlate(struct gpio_chip *chip, static int pm8xxx_mpp_to_irq(struct gpio_chip *chip, unsigned offset) { - struct pm8xxx_mpp *pctrl = container_of(chip, struct pm8xxx_mpp, chip); + struct pm8xxx_mpp *pctrl = gpiochip_get_data(chip); struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; return pin->irq; @@ -552,7 +552,7 @@ static void pm8xxx_mpp_dbg_show_one(struct seq_file *s, unsigned offset, unsigned gpio) { - struct pm8xxx_mpp *pctrl = container_of(chip, struct pm8xxx_mpp, chip); + struct pm8xxx_mpp *pctrl = gpiochip_get_data(chip); struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; static const char * const aout_lvls[] = { @@ -826,7 +826,7 @@ static int pm8xxx_mpp_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;