From patchwork Wed Dec 9 13:34:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 58077 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp672036lbb; Wed, 9 Dec 2015 05:34:31 -0800 (PST) X-Received: by 10.98.1.213 with SMTP id 204mr13027666pfb.128.1449668071003; Wed, 09 Dec 2015 05:34:31 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id nx14si12797123pab.69.2015.12.09.05.34.30; Wed, 09 Dec 2015 05:34:30 -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 S1754213AbbLINea (ORCPT + 4 others); Wed, 9 Dec 2015 08:34:30 -0500 Received: from mail-lf0-f43.google.com ([209.85.215.43]:33747 "EHLO mail-lf0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754193AbbLINe3 (ORCPT ); Wed, 9 Dec 2015 08:34:29 -0500 Received: by lfaz4 with SMTP id z4so34336723lfa.0 for ; Wed, 09 Dec 2015 05:34:28 -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=Z0uHnxLvio2cBwbPmbGMO+oNnET4VL7yM5oDwRKMEYw=; b=hXnWCEM29ZbI0Ze55icq/rlESnolb0lRqjcmcKCu9Pi4xEYhuZ11Udj7URqBcb5KBi CUS57vhMlMNQF6iGxch6AE9Y06zKj+71U1smuM34JLHiFp/SVxGl5GxYO7XzyvskwDFS 9OHyyLZ6NsE/3qT3xur5+PgtQAjtT2Wr/CHw+FSBQJRpeUCfLmzH+Ac+0zqcWL9z9Lka jXlX/fUjFxg6JpG+lCyrZF7BZGGhF+CyvaudW1hQJiM/MAhPmvUAWmmmVl5+trxdMAP2 LbLYoJKcPHz20d5u8BgjsSIZL5gbUfC5N1M7h9RrQqMh+usImj0nVShoecCRDg1bdvp/ ITSA== 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=Z0uHnxLvio2cBwbPmbGMO+oNnET4VL7yM5oDwRKMEYw=; b=No8RUsV9aMq61xp/MFciWQTxZYoZzrrR7ufMn1flsnEjUsUPg4cCka/7fJSbdNgu0c Jm58czBSvAfuoeEcDAONsbxxIKAhPxM0zvwTvVYSo4wcJA8KkOi/P0DICQVhgdVi4paY RFsUFoQSHFwdy2CTSTlEwesyEyEHaokOBAuMNcrcw36MLgv1fMu48urMmtfVfm1ghd9r XI9RwkZcOjhtL1qwhQpVzF3BVBlaCyV8EpxtkFOmF0SGTkRsny6hWOq/PYAg460bIo/H hIIDZ6Os+NBgvtPeTStLt+5xqsLiKqzOE5RJAb0NtRYML41w7goy70weC5K+8g10U6I8 F7gQ== X-Gm-Message-State: ALoCoQnZ4nh2owlu90JTMe7ZpOvjkKA7/K/ipUb7xSp3MEv70Zn3QanrGKAzBu7cniWaga3NZyM+ULpFYTareaRNkINDk/e9ig== X-Received: by 10.25.145.81 with SMTP id t78mr2293446lfd.86.1449668068251; Wed, 09 Dec 2015 05:34:28 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id bm8sm1430835lbb.35.2015.12.09.05.34.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 05:34:27 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Johan Hovold , Alexandre Courbot , Michael Welling , Markus Pargmann Cc: Linus Walleij , Tomasz Figa , Kukjin Kim Subject: [PATCH 121/182] pinctrl: exynos5440: use gpiochip data pointer Date: Wed, 9 Dec 2015 14:34:23 +0100 Message-Id: <1449668063-3532-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: Tomasz Figa Cc: Kukjin Kim Signed-off-by: Linus Walleij --- drivers/pinctrl/samsung/pinctrl-exynos5440.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 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/pinctrl/samsung/pinctrl-exynos5440.c b/drivers/pinctrl/samsung/pinctrl-exynos5440.c index f61f9a6fa9af..00ab63abf1d9 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos5440.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos5440.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include @@ -539,7 +539,7 @@ static const struct pinconf_ops exynos5440_pinconf_ops = { /* gpiolib gpio_set callback function */ static void exynos5440_gpio_set(struct gpio_chip *gc, unsigned offset, int value) { - struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->parent); + struct exynos5440_pinctrl_priv_data *priv = gpiochip_get_data(gc); void __iomem *base = priv->reg_base; u32 data; @@ -553,7 +553,7 @@ static void exynos5440_gpio_set(struct gpio_chip *gc, unsigned offset, int value /* gpiolib gpio_get callback function */ static int exynos5440_gpio_get(struct gpio_chip *gc, unsigned offset) { - struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->parent); + struct exynos5440_pinctrl_priv_data *priv = gpiochip_get_data(gc); void __iomem *base = priv->reg_base; u32 data; @@ -566,7 +566,7 @@ static int exynos5440_gpio_get(struct gpio_chip *gc, unsigned offset) /* gpiolib gpio_direction_input callback function */ static int exynos5440_gpio_direction_input(struct gpio_chip *gc, unsigned offset) { - struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->parent); + struct exynos5440_pinctrl_priv_data *priv = gpiochip_get_data(gc); void __iomem *base = priv->reg_base; u32 data; @@ -586,7 +586,7 @@ static int exynos5440_gpio_direction_input(struct gpio_chip *gc, unsigned offset static int exynos5440_gpio_direction_output(struct gpio_chip *gc, unsigned offset, int value) { - struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->parent); + struct exynos5440_pinctrl_priv_data *priv = gpiochip_get_data(gc); void __iomem *base = priv->reg_base; u32 data; @@ -607,7 +607,7 @@ static int exynos5440_gpio_direction_output(struct gpio_chip *gc, unsigned offse /* gpiolib gpio_to_irq callback function */ static int exynos5440_gpio_to_irq(struct gpio_chip *gc, unsigned offset) { - struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->parent); + struct exynos5440_pinctrl_priv_data *priv = gpiochip_get_data(gc); unsigned int virq; if (offset < 16 || offset > 23) @@ -825,7 +825,7 @@ static int exynos5440_gpiolib_register(struct platform_device *pdev, gc->to_irq = exynos5440_gpio_to_irq; gc->label = "gpiolib-exynos5440"; gc->owner = THIS_MODULE; - ret = gpiochip_add(gc); + ret = gpiochip_add_data(gc, priv); if (ret) { dev_err(&pdev->dev, "failed to register gpio_chip %s, error " "code: %d\n", gc->label, ret);