From patchwork Thu Aug 27 12:06:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 52756 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id C293322DC4 for ; Thu, 27 Aug 2015 12:06:32 +0000 (UTC) Received: by wicbi2 with SMTP id bi2sf17115301wic.3 for ; Thu, 27 Aug 2015 05:06:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=nt88nzASro2YwPCP3TX45ui7mUK9O1kc6apxDIxjsRk=; b=WxUStay6fsplMisuRWulXxr8mGXX3A8pqmdkteVbJBquzKln9lUzPiFm6lh7MWL/Yi qwXTQ40pi5JgaEdVGg65pICUwX7PU0GHZ1cuXuhQqBMJowoJMe6Y0++PYBU3VWZNKY+1 Cz9aQHSviK7RVQd8GQxFKMMbb9ul6JaG8PYFE1wvFkQDNCnM9fkHxA5KhI+kSd//8DLS 7Bxa4cpkjlZJHQNoDIX+Ge6BhM4DDKOtI+H1ED91pdk+0Jh7E14gYCvTPikx1en1sXXP mqiXRrfNT7XZEe3czfb3l0URxFhNdj6ZW5Q2kgHPAxBPTBNIUMc1totmMTi5Asxh91at wixg== X-Gm-Message-State: ALoCoQkQtjzJWHTfd/TGnsfzURQdn6x+Y5ZNecc5JtDiZPKS6Gy3GgyXTlszQdZBgNuK+IgSkk22 X-Received: by 10.180.79.66 with SMTP id h2mr2427835wix.3.1440677191862; Thu, 27 Aug 2015 05:06:31 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.135 with SMTP id q7ls64476laj.77.gmail; Thu, 27 Aug 2015 05:06:31 -0700 (PDT) X-Received: by 10.152.5.69 with SMTP id q5mr2046543laq.92.1440677191717; Thu, 27 Aug 2015 05:06:31 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id k3si1949043lbq.73.2015.08.27.05.06.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Aug 2015 05:06:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by lbcbn3 with SMTP id bn3so9878286lbc.2 for ; Thu, 27 Aug 2015 05:06:31 -0700 (PDT) X-Received: by 10.112.166.2 with SMTP id zc2mr2005591lbb.29.1440677191418; Thu, 27 Aug 2015 05:06:31 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.162.200 with SMTP id yc8csp4595226lbb; Thu, 27 Aug 2015 05:06:30 -0700 (PDT) X-Received: by 10.66.182.161 with SMTP id ef1mr5880397pac.97.1440677190318; Thu, 27 Aug 2015 05:06:30 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6si3319212pdn.207.2015.08.27.05.06.29; Thu, 27 Aug 2015 05:06:30 -0700 (PDT) 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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752182AbbH0MG2 (ORCPT + 2 others); Thu, 27 Aug 2015 08:06:28 -0400 Received: from mail-la0-f53.google.com ([209.85.215.53]:33435 "EHLO mail-la0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752028AbbH0MG2 (ORCPT ); Thu, 27 Aug 2015 08:06:28 -0400 Received: by labns7 with SMTP id ns7so10980683lab.0 for ; Thu, 27 Aug 2015 05:06:26 -0700 (PDT) X-Received: by 10.152.21.71 with SMTP id t7mr2005759lae.118.1440677186348; Thu, 27 Aug 2015 05:06:26 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by smtp.gmail.com with ESMTPSA id z12sm521833lbp.46.2015.08.27.05.06.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Aug 2015 05:06:25 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Alexandre Courbot , Linus Walleij Subject: [PATCH] gpio: tc3589x: use static container helper Date: Thu, 27 Aug 2015 14:06:22 +0200 Message-Id: <1440677182-6779-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 Sender: linux-gpio-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-gpio@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , There is a helper function to do the container_of() magic for the tc3589x GPIO, so use it. Signed-off-by: Linus Walleij --- drivers/gpio/gpio-tc3589x.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpio/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c index 31b244cffabb..d1d585ddb9ab 100644 --- a/drivers/gpio/gpio-tc3589x.c +++ b/drivers/gpio/gpio-tc3589x.c @@ -102,7 +102,7 @@ static struct gpio_chip template_chip = { static int tc3589x_gpio_irq_set_type(struct irq_data *d, unsigned int type) { struct gpio_chip *gc = irq_data_get_irq_chip_data(d); - struct tc3589x_gpio *tc3589x_gpio = container_of(gc, struct tc3589x_gpio, chip); + struct tc3589x_gpio *tc3589x_gpio = to_tc3589x_gpio(gc); int offset = d->hwirq; int regoffset = offset / 8; int mask = 1 << (offset % 8); @@ -130,7 +130,7 @@ static int tc3589x_gpio_irq_set_type(struct irq_data *d, unsigned int type) static void tc3589x_gpio_irq_lock(struct irq_data *d) { struct gpio_chip *gc = irq_data_get_irq_chip_data(d); - struct tc3589x_gpio *tc3589x_gpio = container_of(gc, struct tc3589x_gpio, chip); + struct tc3589x_gpio *tc3589x_gpio = to_tc3589x_gpio(gc); mutex_lock(&tc3589x_gpio->irq_lock); } @@ -138,7 +138,7 @@ static void tc3589x_gpio_irq_lock(struct irq_data *d) static void tc3589x_gpio_irq_sync_unlock(struct irq_data *d) { struct gpio_chip *gc = irq_data_get_irq_chip_data(d); - struct tc3589x_gpio *tc3589x_gpio = container_of(gc, struct tc3589x_gpio, chip); + struct tc3589x_gpio *tc3589x_gpio = to_tc3589x_gpio(gc); struct tc3589x *tc3589x = tc3589x_gpio->tc3589x; static const u8 regmap[] = { [REG_IBE] = TC3589x_GPIOIBE0, @@ -167,7 +167,7 @@ static void tc3589x_gpio_irq_sync_unlock(struct irq_data *d) static void tc3589x_gpio_irq_mask(struct irq_data *d) { struct gpio_chip *gc = irq_data_get_irq_chip_data(d); - struct tc3589x_gpio *tc3589x_gpio = container_of(gc, struct tc3589x_gpio, chip); + struct tc3589x_gpio *tc3589x_gpio = to_tc3589x_gpio(gc); int offset = d->hwirq; int regoffset = offset / 8; int mask = 1 << (offset % 8); @@ -178,7 +178,7 @@ static void tc3589x_gpio_irq_mask(struct irq_data *d) static void tc3589x_gpio_irq_unmask(struct irq_data *d) { struct gpio_chip *gc = irq_data_get_irq_chip_data(d); - struct tc3589x_gpio *tc3589x_gpio = container_of(gc, struct tc3589x_gpio, chip); + struct tc3589x_gpio *tc3589x_gpio = to_tc3589x_gpio(gc); int offset = d->hwirq; int regoffset = offset / 8; int mask = 1 << (offset % 8);