From patchwork Wed Dec 9 13:23:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 554541 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 39F2B1402B4 for ; Thu, 10 Dec 2015 00:23:51 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro-org.20150623.gappssmtp.com header.i=@linaro-org.20150623.gappssmtp.com header.b=retV+sS7; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751673AbbLINXu (ORCPT ); Wed, 9 Dec 2015 08:23:50 -0500 Received: from mail-lb0-f174.google.com ([209.85.217.174]:35522 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753331AbbLINXu (ORCPT ); Wed, 9 Dec 2015 08:23:50 -0500 Received: by lbpu9 with SMTP id u9so29686308lbp.2 for ; Wed, 09 Dec 2015 05:23:48 -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=pdXmXQz3tj7IA3w81QFQSH2VMQym/kKMEFfWbjJE+TQ=; b=retV+sS71Hex/Y8dFJexazKJ1cOwhldKxa6/pupAIZRDsIqzuVPC8NeQyVJs3+FCnk nS36Na116s4mwQpaHXjK2GcS8tdnBPlPjb3WBSOyWOTL9tCJIffYbeU3UtW5nyDtKdDD 6rLTDv3Y1OCaoZC+rKY5DYzLkQw1i3zi+qzylTuw1y4ULqDmuosjXHK6ikoZHOKzVPB2 wjBxyXHwVgWvKbwnlT8w0HEpXFfwrqoStpJmn1wArofw8cKkkgiLqU8f4hMeoOb42wBp yX4qMf52K4PiZ85hNZq83LaEY8GoUAoa/gGGEwbjqo30qyy+CyvLV0iemi4rjS9WW5VK eSgg== 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=pdXmXQz3tj7IA3w81QFQSH2VMQym/kKMEFfWbjJE+TQ=; b=A1iUrC16z9iKkOSFyJ1B2IqBa+tVQppE0wlFaGtLLx6Q+CnK2L22hz+xxbDtJKao64 WjFPKjss7y1IO6/UfjLIZUu4/6N1DHEuMvyJpCALD7fmT2byX+eTWlI3esqffHyIt3ox YqNayrlsrRaLepttXTq5j2SRk7RXvD6ZFuJn4Vorb1j76Jx8NGeSedahjxvASdb/l58R E1Utlroui7MhbBX2uSvSAGJZEVjU7N0hjdbtjxRcYRhu7DT5c75JPgBeEL4/W552wx8P 1BeVMptzDRt9TMqsFRuEOwqIDE12N+f5kTG+p6nLpgN0B5h2BIVgqpqWiCE+s6SX7vMj La5w== X-Gm-Message-State: ALoCoQkF9pUGD5mpC9Vl9ZT99puEaMnhDs02ryisN6EOUtv0Pz4zHCFhT2y4ocUQvpdCMByBHRVMfxOWknQG+xehPvdZ2qy+cQ== X-Received: by 10.112.17.100 with SMTP id n4mr2367568lbd.47.1449667428926; Wed, 09 Dec 2015 05:23:48 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id s18sm1465894lfs.13.2015.12.09.05.23.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 05:23:48 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Johan Hovold , Alexandre Courbot , Michael Welling , Markus Pargmann Cc: Linus Walleij Subject: [PATCH 067/182] gpio: timberdale: use gpiochip data pointer Date: Wed, 9 Dec 2015 14:23:45 +0100 Message-Id: <1449667425-518-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(). Signed-off-by: Linus Walleij --- drivers/gpio/gpio-timberdale.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-timberdale.c b/drivers/gpio/gpio-timberdale.c index dda8f21811eb..a6de10c5275b 100644 --- a/drivers/gpio/gpio-timberdale.c +++ b/drivers/gpio/gpio-timberdale.c @@ -53,7 +53,7 @@ struct timbgpio { static int timbgpio_update_bit(struct gpio_chip *gpio, unsigned index, unsigned offset, bool enabled) { - struct timbgpio *tgpio = container_of(gpio, struct timbgpio, gpio); + struct timbgpio *tgpio = gpiochip_get_data(gpio); u32 reg; spin_lock(&tgpio->lock); @@ -77,7 +77,7 @@ static int timbgpio_gpio_direction_input(struct gpio_chip *gpio, unsigned nr) static int timbgpio_gpio_get(struct gpio_chip *gpio, unsigned nr) { - struct timbgpio *tgpio = container_of(gpio, struct timbgpio, gpio); + struct timbgpio *tgpio = gpiochip_get_data(gpio); u32 value; value = ioread32(tgpio->membase + TGPIOVAL); @@ -98,7 +98,7 @@ static void timbgpio_gpio_set(struct gpio_chip *gpio, static int timbgpio_to_irq(struct gpio_chip *gpio, unsigned offset) { - struct timbgpio *tgpio = container_of(gpio, struct timbgpio, gpio); + struct timbgpio *tgpio = gpiochip_get_data(gpio); if (tgpio->irq_base <= 0) return -EINVAL; @@ -279,7 +279,7 @@ static int timbgpio_probe(struct platform_device *pdev) gc->ngpio = pdata->nr_pins; gc->can_sleep = false; - err = gpiochip_add(gc); + err = gpiochip_add_data(gc, tgpio); if (err) return err;