From patchwork Wed Dec 9 13:49:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 58126 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp680097lbb; Wed, 9 Dec 2015 05:49:09 -0800 (PST) X-Received: by 10.98.7.129 with SMTP id 1mr13164059pfh.70.1449668949415; Wed, 09 Dec 2015 05:49:09 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fj9si12884778pad.43.2015.12.09.05.49.09; Wed, 09 Dec 2015 05:49:09 -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 S1753754AbbLINtI (ORCPT + 4 others); Wed, 9 Dec 2015 08:49:08 -0500 Received: from mail-lb0-f174.google.com ([209.85.217.174]:36053 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753251AbbLINtH (ORCPT ); Wed, 9 Dec 2015 08:49:07 -0500 Received: by lbblt2 with SMTP id lt2so30434272lbb.3 for ; Wed, 09 Dec 2015 05:49:06 -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=miKuvzPwRs4z6U2mFHbQrY4UseShUEhu1DcNhanyzQo=; b=jM9JA5sTtNunCllfggG2LVQcK4myza+kMK34B89b6YvV/hgn7wWWPI+QCIPJExqCZD kXo+eTXzcCmD5JRYMJXklIfsOaMkuIODV6uVqTeP+KY7Ilntt5/KqCSS4A2f+qOgezoC 18Pm+orHcEZSfP+TpXvO2bF8aXeg2WWmlLu3qf+SldtDxWP29GYfhsk/g1XohW9miQSj Tac5nH9RvZSGXhHHahBbKJ3+zmaOTkwPGKkfC3yTs5WnkxnvdW7rn/LYDz/rNVLg0+KT 1hJ/t/h0TH5iqpWrWhggUouezxoIhZqod6M14xxmdhjQdjA3bawHX4S7nknAPllp64wF ZMEA== 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=miKuvzPwRs4z6U2mFHbQrY4UseShUEhu1DcNhanyzQo=; b=Y9UTyFdzRYuAkJQnBX7GAlHVAjxCR3S0WdvkVkCL4fdt4C3653n79Ujrli5eMywURZ Q2sHt3XgvMhLBb1JM5FhwrBZbawvsNPJ1NSob7oumAphXI3dJUzit4pfO+DhksAcg1g3 4132mY/D4IfvyW9u8vu443NYwpw1pyMHSawFEULNRwrJ34lOQ1PcLGH0gSdYIKNcu+xV ULbAD6CmSsD9Y2z8Fo0HAWFGrKqKr5zL1KzNp3PTBj+XHMUX2Bth7Znm3S1L1O3Z90XB hgAyLQmkxXrpW6Ldlst025Y5+Ivce1CmBH9JvngY0OrH1eIZhktWg39G+6zSRyLNdYNd kFTQ== X-Gm-Message-State: ALoCoQmkqNtZSqScmFTfvBNL+QDO1X8UPz2P/CBD2Lf3na5JzXlLlvfitLImt4DonOn/0tLEeUsvQGdcKfe2JcyH9zXvR67pOQ== X-Received: by 10.112.202.101 with SMTP id kh5mr2414269lbc.66.1449668946337; Wed, 09 Dec 2015 05:49:06 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id x13sm1441388lfd.7.2015.12.09.05.49.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 05:49:05 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Johan Hovold , Alexandre Courbot , Michael Welling , Markus Pargmann , Feng Tang Cc: Linus Walleij Subject: [PATCH 170/182] platform: x86: intel-pmic: use gpiochip data pointer Date: Wed, 9 Dec 2015 14:49:00 +0100 Message-Id: <1449668940-6643-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: Feng Tang Signed-off-by: Linus Walleij --- It seems to be unclear who maintains platform/x86, so I'm just gonna merge this patch into the GPIO tree unless there is a protest from someone who wants to have a say. --- drivers/platform/x86/intel_pmic_gpio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 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/platform/x86/intel_pmic_gpio.c b/drivers/platform/x86/intel_pmic_gpio.c index 0e73fd10ba72..63b371d6ee55 100644 --- a/drivers/platform/x86/intel_pmic_gpio.c +++ b/drivers/platform/x86/intel_pmic_gpio.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include @@ -174,7 +174,7 @@ static int pmic_irq_type(struct irq_data *data, unsigned type) static int pmic_gpio_to_irq(struct gpio_chip *chip, unsigned offset) { - struct pmic_gpio *pg = container_of(chip, struct pmic_gpio, chip); + struct pmic_gpio *pg = gpiochip_get_data(chip); return pg->irq_base + offset; } @@ -279,7 +279,7 @@ static int platform_pmic_gpio_probe(struct platform_device *pdev) mutex_init(&pg->buslock); pg->chip.parent = dev; - retval = gpiochip_add(&pg->chip); + retval = gpiochip_add_data(&pg->chip, pg); if (retval) { pr_err("Can not add pmic gpio chip\n"); goto err;