From patchwork Wed Dec 9 13:48:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 58123 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp679615lbb; Wed, 9 Dec 2015 05:48:14 -0800 (PST) X-Received: by 10.98.87.138 with SMTP id i10mr12960565pfj.69.1449668894832; Wed, 09 Dec 2015 05:48:14 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s90si12866349pfi.45.2015.12.09.05.48.14; Wed, 09 Dec 2015 05:48:14 -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 S1754166AbbLINsO (ORCPT + 4 others); Wed, 9 Dec 2015 08:48:14 -0500 Received: from mail-lf0-f51.google.com ([209.85.215.51]:33069 "EHLO mail-lf0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753092AbbLINsN (ORCPT ); Wed, 9 Dec 2015 08:48:13 -0500 Received: by lfaz4 with SMTP id z4so34607428lfa.0 for ; Wed, 09 Dec 2015 05:48:12 -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=30evbXUQ2Zr0Q7C3Fg0hZMuZ6REskmZujTuxM9ogNA0=; b=JmggfoqlGxv37YNmHY9NcmcHUcaJnRcC8OS3q3N7zdv3j8fPfD739eesVu3H+mumMO jXGWCDIt9g2Em/w4ydSX73HxCJfz0pPLOD0sno83JWakNGP5d84P33Vy8a++Q4bARtaf Yrq39nXFhluKEJcdv+EZ6cuYGWRcHfWXawfz5JoeQxcOMuJTJDrcjRZc3GFKhtdAcQHi g4fvP2v+2LgrKJoEMztInyhPnTFF4sm10wyPQ7X+IysktQ0gNixfq95y5AhLItdIRav9 EYbOoqQXATK0FJF9nK0JlQFDJzi5e1OJvST6mWQ1EgKU+krUWzHuSlw5mDE3F8Op4HCg KpAA== 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=30evbXUQ2Zr0Q7C3Fg0hZMuZ6REskmZujTuxM9ogNA0=; b=eOaGfu4sGr/OfipJVDat6z31XJCc4R4Nbh2QZEMNWSM3L1Jx9ScLXKfY4u9nnqxUTs ApYmCUipTnrftnP4nTDWbbtKdiKllUtVBpph1FcGrrJHCEzsR6wQ80ToxxJTDd2lRrlQ 4s9xmFjqq90C9DUfCI9DSSGRBfkwMdV52lUx4q/7v2LohJQ4bDWfArVsUuBLlZDzvGDw pqMYmbSTm/cUeu4VRxVtmYi0Rz0caGfuywK8vlhN3aSrGx+UF1fMUGcZIQJJ5ya48uZo ch4ifgEXzH33PImYtHd+LSHSERPLXjL0yui9PTp9wMecTK3f/c6YjOhe3PJ0KPJ/OFEx tktA== X-Gm-Message-State: ALoCoQleE/XAr3svnt6DlfrP/OpFYEdcChrTuhLlYkIuFSfr81xPMGB1ntJDIsg2WF8DlGxNw8n/WbysQdlHnswoPIOvQW39Kg== X-Received: by 10.25.157.195 with SMTP id g186mr2253250lfe.147.1449668892293; Wed, 09 Dec 2015 05:48:12 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id j83sm1445860lfi.47.2015.12.09.05.48.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 05:48:11 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Johan Hovold , Alexandre Courbot , Michael Welling , Markus Pargmann , Lee Jones Cc: Linus Walleij Subject: [PATCH 167/182] mfd: tps65010: use gpiochip data pointer Date: Wed, 9 Dec 2015 14:48:09 +0100 Message-Id: <1449668889-6451-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: Lee Jones Signed-off-by: Linus Walleij --- Lee please ACK this so I can take it through the GPIO tree. --- drivers/mfd/tps65010.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 Acked-by: Lee Jones diff --git a/drivers/mfd/tps65010.c b/drivers/mfd/tps65010.c index b96847491277..1ffb8ebd7b2c 100644 --- a/drivers/mfd/tps65010.c +++ b/drivers/mfd/tps65010.c @@ -34,7 +34,7 @@ #include -#include +#include /*-------------------------------------------------------------------------*/ @@ -477,7 +477,7 @@ tps65010_output(struct gpio_chip *chip, unsigned offset, int value) if (offset < 4) { struct tps65010 *tps; - tps = container_of(chip, struct tps65010, chip); + tps = gpiochip_get_data(chip); if (!(tps->outmask & (1 << offset))) return -EINVAL; tps65010_set_gpio_out_value(offset + 1, value); @@ -494,7 +494,7 @@ static int tps65010_gpio_get(struct gpio_chip *chip, unsigned offset) int value; struct tps65010 *tps; - tps = container_of(chip, struct tps65010, chip); + tps = gpiochip_get_data(chip); if (offset < 4) { value = i2c_smbus_read_byte_data(tps->client, TPS_DEFGPIO); @@ -651,7 +651,7 @@ static int tps65010_probe(struct i2c_client *client, tps->chip.ngpio = 7; tps->chip.can_sleep = 1; - status = gpiochip_add(&tps->chip); + status = gpiochip_add_data(&tps->chip, tps); if (status < 0) dev_err(&client->dev, "can't add gpiochip, err %d\n", status);