From patchwork Wed Dec 9 13:17:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 57988 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp662030lbb; Wed, 9 Dec 2015 05:17:27 -0800 (PST) X-Received: by 10.98.73.13 with SMTP id w13mr12717432pfa.72.1449667047545; Wed, 09 Dec 2015 05:17:27 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s26si12711651pfi.57.2015.12.09.05.17.27; Wed, 09 Dec 2015 05:17:27 -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 S1753902AbbLINR1 (ORCPT + 4 others); Wed, 9 Dec 2015 08:17:27 -0500 Received: from mail-lb0-f174.google.com ([209.85.217.174]:34470 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753598AbbLINR0 (ORCPT ); Wed, 9 Dec 2015 08:17:26 -0500 Received: by lbbcs9 with SMTP id cs9so29706161lbb.1 for ; Wed, 09 Dec 2015 05:17:25 -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=abaDFH9fmc+lBT6xrhpFsQ5CmkXf1MG0dbd1G1G4Zo8=; b=joC24NP2LB8Vp/Z+gcDUHa3EJJRLGKf4woD7SsFE6ELMzOyvkdtoOpqNeTfh6iUlrY 7SGEh3EurVTLjmfORQOyjV/FbB2+knANNQn4Rcon9csLZllpHQcvrdz5K8VPYve+bMF9 wIV0dxqvfDm3I0sd4sMJSrVdbUAvUZlp+fRGBCvvbnT1pyU/a2liIwxCO/HOmkAWCZo4 yNmM9Qf6Ys2JhVky1Fhu03nXs95djhf5gacZNhSM8V+du4Cw2bHqHvgr/0UKP/86gitc pGKREPfWClHwSGWmfY+fWcEvm22a/lPRS0S0gLoR57mJFhir6Hc/+wVxyJOWmitshJBL XQiQ== 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=abaDFH9fmc+lBT6xrhpFsQ5CmkXf1MG0dbd1G1G4Zo8=; b=Dx2dFnIWONhsZe+qtfhCr2ZySQalS+Vcl8/R3TglVmGmotiFNpdfTpDd9QDGeksmtU hyNcyHxp2d+3wYsgJt8aQSda6OM0uXOnAlT2zPPr3m4/plMkQI2LYHZ2i9xOOS31exOg /M6F4h2BEd+CkX8UJdjF0aEsj/SHeR/eERUCJr8HoukefnAoVEDzdOB2e3p8XnVbftOj 7a2+2oTtbLa3fE8Fm9pXHmaxrQzzMic/8F8rUmRs+y2Y+b1mxupDTQcNWzbFMNdDhBq1 aZxZu6NdJ9nzYFLXMy9D3auNF8hmYLTUVd2j6CSMTpNC15fiHBbb7ZN5WRgPgQKg78CZ /rGg== X-Gm-Message-State: ALoCoQkJXaemnyrjmOKmynKvGnvreXOHjZ+4Rtzq2BCM835AeDW/nmrLSRqxcceJzwn1cVMH8b1qZnFt4MA8U5Ke+2ru29t33w== X-Received: by 10.112.11.169 with SMTP id r9mr2475324lbb.8.1449667045155; Wed, 09 Dec 2015 05:17:25 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id qp7sm1429900lbc.24.2015.12.09.05.17.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 05:17:24 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Johan Hovold , Alexandre Courbot , Michael Welling , Markus Pargmann Cc: Linus Walleij , Roland Stigge Subject: [PATCH 033/182] gpio: max730x: use gpiochip data pointer Date: Wed, 9 Dec 2015 14:17:21 +0100 Message-Id: <1449667041-31314-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: Roland Stigge Signed-off-by: Linus Walleij --- drivers/gpio/gpio-max730x.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/gpio/gpio-max730x.c b/drivers/gpio/gpio-max730x.c index 5d6a723cb414..08807368f007 100644 --- a/drivers/gpio/gpio-max730x.c +++ b/drivers/gpio/gpio-max730x.c @@ -50,7 +50,7 @@ static int max7301_direction_input(struct gpio_chip *chip, unsigned offset) { - struct max7301 *ts = container_of(chip, struct max7301, chip); + struct max7301 *ts = gpiochip_get_data(chip); u8 *config; u8 offset_bits, pin_config; int ret; @@ -92,7 +92,7 @@ static int __max7301_set(struct max7301 *ts, unsigned offset, int value) static int max7301_direction_output(struct gpio_chip *chip, unsigned offset, int value) { - struct max7301 *ts = container_of(chip, struct max7301, chip); + struct max7301 *ts = gpiochip_get_data(chip); u8 *config; u8 offset_bits; int ret; @@ -120,7 +120,7 @@ static int max7301_direction_output(struct gpio_chip *chip, unsigned offset, static int max7301_get(struct gpio_chip *chip, unsigned offset) { - struct max7301 *ts = container_of(chip, struct max7301, chip); + struct max7301 *ts = gpiochip_get_data(chip); int config, level = -EINVAL; /* First 4 pins are unused in the controller */ @@ -148,7 +148,7 @@ static int max7301_get(struct gpio_chip *chip, unsigned offset) static void max7301_set(struct gpio_chip *chip, unsigned offset, int value) { - struct max7301 *ts = container_of(chip, struct max7301, chip); + struct max7301 *ts = gpiochip_get_data(chip); /* First 4 pins are unused in the controller */ offset += 4; @@ -213,7 +213,7 @@ int __max730x_probe(struct max7301 *ts) } } - ret = gpiochip_add(&ts->chip); + ret = gpiochip_add_data(&ts->chip, ts); if (ret) goto exit_destroy;