From patchwork Wed Dec 9 13:22: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: 554529 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 3CE4F140291 for ; Thu, 10 Dec 2015 00:22:32 +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=icaltGx/; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754525AbbLINW3 (ORCPT ); Wed, 9 Dec 2015 08:22:29 -0500 Received: from mail-lf0-f48.google.com ([209.85.215.48]:33324 "EHLO mail-lf0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754345AbbLINW1 (ORCPT ); Wed, 9 Dec 2015 08:22:27 -0500 Received: by lfaz4 with SMTP id z4so34101041lfa.0 for ; Wed, 09 Dec 2015 05:22:26 -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=79+B0Yl2GV89RsFCQjxYIjt1FdwWtHPufWdOGZ9drys=; b=icaltGx/OFntxlM7FX1LU/d88yT6Kf5wwAwycWQwll3eZzVmKCiRyaK8gJM7LqMlAE IMDqGOMLn3ypO2uZj1AzNAKGvrg+tOacX8QxbQ2o/tSg5A0Mo7StW0NyK6w9gRskx3zE suwzEIayhtAg32gNJgmpIJh8ctPxhPil5eWw73UHbaMJDQSQ2s5sG7KQDUZfvCU2ewXM r2fJ0p8AgVUrf3o9aWiAS25zBZetJyeMNLSdGHusDiue8Pc4y/HSbtj4a6uBrQUHFPY5 iAOcfdqxQ56CwxWrgt5bBjg/nfSor8q3qc4rAFE+/mZs1wYsXhRolJbXz1lrjzIxSFfH 8m4A== 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=79+B0Yl2GV89RsFCQjxYIjt1FdwWtHPufWdOGZ9drys=; b=bYFHRLXr3XqBeQwaNlGpEsjgIon15k1enjPCEji4qCeb4LmZwjRqVWTvYLIXvQ7nSz OiPqsjL4L7wvC9gk5RCtWW2C17n1i6wyB1WUztwzGDGwwVipKj/1ULA2W72DyNZQCrhf eLVJq2XIlOXf0ePKzi+fpcr/HO6K03A6khV6blJfUgNqxbVfT5897s0l0RH5SmKNV4H0 AIHfiKbKSiV0rk48jnIHmonGpzmIWprwfqNeUJ+1z3ncJCrA02G53+Mkx8kYp1MkpR9n 3LfK2W6zyi7PF2gcf5Y+gTpGOt8jPEcfgJ0b15/mtBo69PMBsAhcsxUy4K+RzhF6bWO5 OWjQ== X-Gm-Message-State: ALoCoQlSPdsUx8DeWRzifec8P71e8IDOeYCZNkj5lZNiUpW5p0ofLKrgGT1yeMLsp6nX/CKtuNu8bI8zloES1ZdadwfBZqEpOA== X-Received: by 10.25.150.204 with SMTP id y195mr2250309lfd.66.1449667346269; Wed, 09 Dec 2015 05:22:26 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id rb3sm1424868lbb.18.2015.12.09.05.22.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 05:22:25 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Johan Hovold , Alexandre Courbot , Michael Welling , Markus Pargmann Cc: Linus Walleij , Paul Bolle , Kukjin Kim Subject: [PATCH 056/182] gpio: samsung: use gpiochip data pointer Date: Wed, 9 Dec 2015 14:22:22 +0100 Message-Id: <1449667342-32435-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: Paul Bolle Cc: Kukjin Kim Signed-off-by: Linus Walleij --- drivers/gpio/gpio-samsung.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c index 7c288ba4dc87..4cb4a314c02b 100644 --- a/drivers/gpio/gpio-samsung.c +++ b/drivers/gpio/gpio-samsung.c @@ -753,7 +753,7 @@ static void __init samsung_gpiolib_add(struct samsung_gpio_chip *chip) #endif /* gpiochip_add() prints own failure message on error. */ - ret = gpiochip_add(gc); + ret = gpiochip_add_data(gc, chip); if (ret >= 0) s3c_gpiolib_track(chip); } @@ -862,7 +862,7 @@ static void __init samsung_gpiolib_add_4bit2_chips(struct samsung_gpio_chip *chi int samsung_gpiolib_to_irq(struct gpio_chip *chip, unsigned int offset) { - struct samsung_gpio_chip *samsung_chip = container_of(chip, struct samsung_gpio_chip, chip); + struct samsung_gpio_chip *samsung_chip = gpiochip_get_data(chip); return samsung_chip->irq_base + offset; }