From patchwork Wed Dec 9 13:30:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 58048 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp669613lbb; Wed, 9 Dec 2015 05:30:44 -0800 (PST) X-Received: by 10.98.10.141 with SMTP id 13mr12987228pfk.20.1449667843721; Wed, 09 Dec 2015 05:30:43 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r20si12813275pfa.51.2015.12.09.05.30.43; Wed, 09 Dec 2015 05:30:43 -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 S1754438AbbLINam (ORCPT + 4 others); Wed, 9 Dec 2015 08:30:42 -0500 Received: from mail-lf0-f45.google.com ([209.85.215.45]:35736 "EHLO mail-lf0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754416AbbLINak (ORCPT ); Wed, 9 Dec 2015 08:30:40 -0500 Received: by lfdl133 with SMTP id l133so34085065lfd.2 for ; Wed, 09 Dec 2015 05:30:39 -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=8fXK1Js+hVUBQgh5aW5p9DFk5PTmMzWAC6LIgckVGg4=; b=khsjVGDJesjpyUnJD32cCHBwKCuab8VwtVPkWTeRLIngc6bo0r8W+/7UC0V/1Ip9li 35xW0qyqLgdzPcFVMDE1sT71rJIpcMnHyZG9yBUND5GbiMz9P388smaI1jxhNbCORi1t 14cHOGMWEYwaVlSvqsqIp/8XU9CYthlr0yYaKW0wPNZuAC4Jn6lCuj3yaqUMZ5FDWnfL mV33ePz71ZBZbJPN3wDbotUZ7GvjPu+h811fK02W3z0T+I951rigE/PJk5tewKP34iHp AQyjM8UsepVGxZ/stpPw6KTIl3t7oOAjFF1uTCOkCXHwn9VZ1c1Jerfb+W7oTJLu2BbV GhZw== 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=8fXK1Js+hVUBQgh5aW5p9DFk5PTmMzWAC6LIgckVGg4=; b=WoWEB2+5mvoOZWdOUrIgljDdbpTkOd/HpBICD7pfnSs56i5oMM9BCCpI0uz5IdTSjB +aMmDXXQYz7dKU9Qxd0oWXJbS12udbEr3B12loqDStIahPAl3CQ4uicsMnszgsKtI0hE 6P929UcsWhxuzosWNqVO86lvYAmVpcqDuip4PtdCmRxWxeH9HPgyV7wVCy9lwniw2JnC xC5mqAQFIv+C3HhReEdRXGID7PsAPAtQcv3NNCiszod9OTz9iu7h0Y0Air3M2Rve4+Oi 7Y4/cGAFGkcobG91KLh1ys+HqmkjSKB6iSpi1K38kSOx2cjk4cFS4k4QJ62Eyh5Wz1Am c6Kw== X-Gm-Message-State: ALoCoQmoV/Wzuqu5QGdGqmorCExcTQnZksnw6f85lCPpmnnMJ8K/wcspHx96BsGBym6bzcnDa66LgFeuhHkCesJ3ozvPGEp0TA== X-Received: by 10.25.19.69 with SMTP id j66mr2246065lfi.25.1449667839351; Wed, 09 Dec 2015 05:30:39 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id um1sm1401207lbb.23.2015.12.09.05.30.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 05:30:38 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Johan Hovold , Alexandre Courbot , Michael Welling , Markus Pargmann Cc: Linus Walleij , Stephen Warren , Eric Anholt Subject: [PATCH 092/182] pinctrl: bcm2835: use gpiochip data pointer Date: Wed, 9 Dec 2015 14:30:36 +0100 Message-Id: <1449667836-1932-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: Stephen Warren Cc: Eric Anholt Signed-off-by: Linus Walleij --- drivers/pinctrl/bcm/pinctrl-bcm2835.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/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c index 0bc1abcedbae..52c15234eb09 100644 --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -337,7 +337,7 @@ static int bcm2835_gpio_direction_input(struct gpio_chip *chip, unsigned offset) static int bcm2835_gpio_get(struct gpio_chip *chip, unsigned offset) { - struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->parent); + struct bcm2835_pinctrl *pc = gpiochip_get_data(chip); return bcm2835_gpio_get_bit(pc, GPLEV0, offset); } @@ -350,14 +350,14 @@ static int bcm2835_gpio_direction_output(struct gpio_chip *chip, static void bcm2835_gpio_set(struct gpio_chip *chip, unsigned offset, int value) { - struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->parent); + struct bcm2835_pinctrl *pc = gpiochip_get_data(chip); bcm2835_gpio_set_bit(pc, value ? GPSET0 : GPCLR0, offset); } static int bcm2835_gpio_to_irq(struct gpio_chip *chip, unsigned offset) { - struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->parent); + struct bcm2835_pinctrl *pc = gpiochip_get_data(chip); return irq_linear_revmap(pc->irq_domain, offset); } @@ -1020,7 +1020,7 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) } } - err = gpiochip_add(&pc->gpio_chip); + err = gpiochip_add_data(&pc->gpio_chip, pc); if (err) { dev_err(dev, "could not add GPIO chip\n"); return err;