From patchwork Tue Apr 21 15:42:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 463375 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 B3A761401E7 for ; Wed, 22 Apr 2015 01:48:20 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=AjHZ5TGx; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932310AbbDUPrr (ORCPT ); Tue, 21 Apr 2015 11:47:47 -0400 Received: from mail-la0-f50.google.com ([209.85.215.50]:33878 "EHLO mail-la0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755820AbbDUPnR (ORCPT ); Tue, 21 Apr 2015 11:43:17 -0400 Received: by laat2 with SMTP id t2so154323827laa.1; Tue, 21 Apr 2015 08:43:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=jqtwkhleQRSCZR/Dkt2gLk7VGUnPdOoFhthMHh47duo=; b=AjHZ5TGxPZo43QddHJZNjr02j/BvUsi6ZncqGXoOWgob7hlz5qP0TfQo/rxzCUrJia dTACRfaPKoZIrhU4wAMYFklQ17pLzmUL0r40jGH0NhBFHK8lCtKOEbNYBAZX9G5KsKtx P8lZA4K+fByNbofbWGQodSW7zqcPQI7AGRDoQ38etX092hRE1gIOcTny9nsWd7k46n4l Z9SHFwGHdhqPggvMY9V9leaSiDyFkqsoWPoLAXFb7w5N/c4VbXmEkdPN6UYpGCdSd30X veqVjC+DX+YYSpASpNl+LFpJhwRdk0zcPmigtUqO/zhxYoZkIAyYsa5izWFxoviJGoHx u6RQ== X-Received: by 10.112.13.73 with SMTP id f9mr20958824lbc.124.1429630995363; Tue, 21 Apr 2015 08:43:15 -0700 (PDT) Received: from xi.terra (c193-14-96-226.cust.tele2.se. [193.14.96.226]) by mx.google.com with ESMTPSA id wm10sm483893lbb.26.2015.04.21.08.43.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Apr 2015 08:43:10 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.84) (envelope-from ) id 1YkaKM-00074K-0J; Tue, 21 Apr 2015 17:43:10 +0200 From: Johan Hovold To: Linus Walleij Cc: Alexandre Courbot , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 07/23] gpio: sysfs: rename gpiochip registration functions Date: Tue, 21 Apr 2015 17:42:15 +0200 Message-Id: <1429630951-27082-8-git-send-email-johan@kernel.org> X-Mailer: git-send-email 2.0.5 In-Reply-To: <1429630951-27082-1-git-send-email-johan@kernel.org> References: <1429630951-27082-1-git-send-email-johan@kernel.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Rename the gpio-chip export/unexport functions to the more descriptive names gpiochip_register and gpiochip_unregister. Signed-off-by: Johan Hovold --- drivers/gpio/gpiolib-sysfs.c | 13 +++++++------ drivers/gpio/gpiolib.c | 4 ++-- drivers/gpio/gpiolib.h | 8 ++++---- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c index 2f8bdce792f6..31434c5a90ef 100644 --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c @@ -750,13 +750,14 @@ void gpiod_unexport(struct gpio_desc *desc) } EXPORT_SYMBOL_GPL(gpiod_unexport); -int gpiochip_export(struct gpio_chip *chip) +int gpiochip_register(struct gpio_chip *chip) { struct device *dev; - /* Many systems register gpio chips for SOC support very early, + /* + * Many systems add gpio chips for SOC support very early, * before driver model support is available. In those cases we - * export this later, in gpiolib_sysfs_init() ... here we just + * register later, in gpiolib_sysfs_init() ... here we just * verify that _some_ field of gpio_class got initialized. */ if (!gpio_class.p) @@ -776,7 +777,7 @@ int gpiochip_export(struct gpio_chip *chip) return 0; } -void gpiochip_unexport(struct gpio_chip *chip) +void gpiochip_unregister(struct gpio_chip *chip) { struct gpio_desc *desc; unsigned int i; @@ -821,7 +822,7 @@ static int __init gpiolib_sysfs_init(void) continue; /* - * TODO we yield gpio_lock here because gpiochip_export() + * TODO we yield gpio_lock here because gpiochip_register() * acquires a mutex. This is unsafe and needs to be fixed. * * Also it would be nice to use gpiochip_find() here so we @@ -829,7 +830,7 @@ static int __init gpiolib_sysfs_init(void) * gpio_lock prevents us from doing this. */ spin_unlock_irqrestore(&gpio_lock, flags); - status = gpiochip_export(chip); + status = gpiochip_register(chip); spin_lock_irqsave(&gpio_lock, flags); } spin_unlock_irqrestore(&gpio_lock, flags); diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 5a5c208d31c7..fefc36211205 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -285,7 +285,7 @@ int gpiochip_add(struct gpio_chip *chip) of_gpiochip_add(chip); acpi_gpiochip_add(chip); - status = gpiochip_export(chip); + status = gpiochip_register(chip); if (status) goto err_remove_chip; @@ -330,7 +330,7 @@ void gpiochip_remove(struct gpio_chip *chip) unsigned id; bool requested = false; - gpiochip_unexport(chip); + gpiochip_unregister(chip); gpiochip_irqchip_remove(chip); diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h index 54bc5ec91398..69458a022c90 100644 --- a/drivers/gpio/gpiolib.h +++ b/drivers/gpio/gpiolib.h @@ -149,17 +149,17 @@ static int __maybe_unused gpio_chip_hwgpio(const struct gpio_desc *desc) #ifdef CONFIG_GPIO_SYSFS -int gpiochip_export(struct gpio_chip *chip); -void gpiochip_unexport(struct gpio_chip *chip); +int gpiochip_register(struct gpio_chip *chip); +void gpiochip_unregister(struct gpio_chip *chip); #else -static inline int gpiochip_export(struct gpio_chip *chip) +static inline int gpiochip_register(struct gpio_chip *chip) { return 0; } -static inline void gpiochip_unexport(struct gpio_chip *chip) +static inline void gpiochip_unregister(struct gpio_chip *chip) { }