From patchwork Thu Feb 11 10:26:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 61716 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp105292lbl; Thu, 11 Feb 2016 02:27:02 -0800 (PST) X-Received: by 10.98.65.203 with SMTP id g72mr65780822pfd.44.1455186411733; Thu, 11 Feb 2016 02:26:51 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p9si11788649pfa.74.2016.02.11.02.26.51; Thu, 11 Feb 2016 02:26:51 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751404AbcBKK0u (ORCPT + 4 others); Thu, 11 Feb 2016 05:26:50 -0500 Received: from mail-wm0-f51.google.com ([74.125.82.51]:38532 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751158AbcBKK0s (ORCPT ); Thu, 11 Feb 2016 05:26:48 -0500 Received: by mail-wm0-f51.google.com with SMTP id p63so61849795wmp.1 for ; Thu, 11 Feb 2016 02:26:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hs7VPM7Gkz9+9cZK1MdbrVJNL5tHyS51uvUDktGNyI8=; b=Q+45NfVUBC93g26zGxR6Pc0r1TN9ey73tU4bmlJXJDQFHUVUVxgi8dOE1tg+AQfKLf GCoWiq/iReij44w9PKgvwVQ4QsTbF3zraO9aCKk2Lmn+sGVAwuRmZ+NN7261LidwjKj3 fQv1RAHjVT5XSix+z+J96o6s850U2d+VcorzQ= 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:in-reply-to :references; bh=hs7VPM7Gkz9+9cZK1MdbrVJNL5tHyS51uvUDktGNyI8=; b=VhmSaKAY3UoG+6n4LXrQqp+SjKD+WCdCEwq9bygrj44t51qZXMAIkXuqXpXRJKV1KO FbjhzkrJFOtcjD3XuuYUxLk/U4oSmuMVKeIVfLqUGoEwzTG6xQBUVHToui3v0X0F7LGD ej56zF+WRJQB2m46DkusWVIVnRRR/uLG4XrwzmmWoTdGIndll+4t/NGso8E/9A//P+r5 kyQbrhjHqFFb+2y+4b53uYeieQ/Xc8qKQAfwP7O00NKTQsatNZFwfrX0/uz8kG8qzaAJ 27bP8lhggdZu3ByRKbXTg14OzKwBHAPndbMksPjzA1TFs8KOSSU5P3fW9dQbacHV5aZC AfXw== X-Gm-Message-State: AG10YOQzCHw6Bn4QQyWgbSTRKcBlteE+yaXtCeLq4DM1ij4PPlfvu+QP3beI8Jwu1KwDPVYz X-Received: by 10.28.127.150 with SMTP id a144mr15615273wmd.25.1455186407762; Thu, 11 Feb 2016 02:26:47 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id jo6sm6856241wjb.48.2016.02.11.02.26.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Feb 2016 02:26:47 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Alexandre Courbot , Johan Hovold , Michael Welling , Markus Pargmann Cc: Bamvor Jian Zhang , Grant Likely , Linus Walleij Subject: [PATCH 6/6] gpio: move the pin ranges into gpio_device Date: Thu, 11 Feb 2016 11:26:23 +0100 Message-Id: <1455186383-28004-7-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1455186383-28004-1-git-send-email-linus.walleij@linaro.org> References: <1455186383-28004-1-git-send-email-linus.walleij@linaro.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Instead of keeping this reference to the pin ranges in the client driver-supplied gpio_chip, move it to the internal gpio_device as the drivers have no need to inspect this. Signed-off-by: Linus Walleij --- drivers/gpio/gpiolib.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 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/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 157ab40d19b1..08e93857a7d5 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -532,8 +532,7 @@ int gpiochip_add_data(struct gpio_chip *chip, void *data) spin_unlock_irqrestore(&gpio_lock, flags); #ifdef CONFIG_PINCTRL - /* FIXME: move pin ranges to gpio_device */ - INIT_LIST_HEAD(&chip->pin_ranges); + INIT_LIST_HEAD(&gdev->pin_ranges); #endif status = gpiochip_set_desc_names(chip); @@ -1036,7 +1035,7 @@ int gpiochip_add_pingroup_range(struct gpio_chip *chip, gpio_offset, gpio_offset + pin_range->range.npins - 1, pinctrl_dev_get_devname(pctldev), pin_group); - list_add_tail(&pin_range->node, &chip->pin_ranges); + list_add_tail(&pin_range->node, &gdev->pin_ranges); return 0; } @@ -1085,7 +1084,7 @@ int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, pinctl_name, pin_offset, pin_offset + npins - 1); - list_add_tail(&pin_range->node, &chip->pin_ranges); + list_add_tail(&pin_range->node, &gdev->pin_ranges); return 0; } @@ -1098,8 +1097,9 @@ EXPORT_SYMBOL_GPL(gpiochip_add_pin_range); void gpiochip_remove_pin_ranges(struct gpio_chip *chip) { struct gpio_pin_range *pin_range, *tmp; + struct gpio_device *gdev = chip->gpiodev; - list_for_each_entry_safe(pin_range, tmp, &chip->pin_ranges, node) { + list_for_each_entry_safe(pin_range, tmp, &gdev->pin_ranges, node) { list_del(&pin_range->node); pinctrl_remove_gpio_range(pin_range->pctldev, &pin_range->range);