From patchwork Mon May 4 15:10:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 467645 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 A9C461402AB for ; Tue, 5 May 2015 01:14:00 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=fHlinbbF; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751010AbbEDPNt (ORCPT ); Mon, 4 May 2015 11:13:49 -0400 Received: from mail-la0-f54.google.com ([209.85.215.54]:36723 "EHLO mail-la0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751292AbbEDPNm (ORCPT ); Mon, 4 May 2015 11:13:42 -0400 Received: by lagv1 with SMTP id v1so106307416lag.3; Mon, 04 May 2015 08:13:41 -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=MO859u6P8Kdt4QMfgX2qk+JK6Tlnp5oMrcnzzPpqzW4=; b=fHlinbbFVXnQzo8t/aBaUE53fK85Qor+k7fLtf1OpGkEnYZv2/DAkyZEho0SK/+Gav z0+gADVDr72TAs3H/K+F+f3i6nZnNOLZynbqPvd+IFqfB0/joJ69Rh7KVTX5oBacdR6p u5b7cCd9AtS5bg4yVNZHSsgzcGv3NnV2FH8RGyOzW6KACyZnXYoRiWH8VZoS4Kzj9WoY aMfTjQJXnG8WWBJaJkVo6wFeLNLlIups7k9xM52iqnGpAR2PpwBWdslceErc31Q6PyUt +OZ5d0UHBr0CMdPOR85iIKkh8JJcmG7Z3RklRuhpgZg/+Jj1CIBfq0oeYUvtmaP8qwAI hrVA== X-Received: by 10.152.43.225 with SMTP id z1mr19070830lal.53.1430752420984; Mon, 04 May 2015 08:13:40 -0700 (PDT) Received: from xi.terra (c193-14-96-226.cust.tele2.se. [193.14.96.226]) by mx.google.com with ESMTPSA id mx10sm3412433lbb.20.2015.05.04.08.13.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 May 2015 08:13:40 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.84) (envelope-from ) id 1YpI3y-00042E-BH; Mon, 04 May 2015 17:13:42 +0200 From: Johan Hovold To: Linus Walleij Cc: Alexandre Courbot , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v2 07/23] gpio: sysfs: rename gpiochip registration functions Date: Mon, 4 May 2015 17:10:32 +0200 Message-Id: <1430752248-15401-8-git-send-email-johan@kernel.org> X-Mailer: git-send-email 2.0.5 In-Reply-To: <1430752248-15401-1-git-send-email-johan@kernel.org> References: <1430752248-15401-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_sysfs_register and gpiochip_sysfs_unregister. Signed-off-by: Johan Hovold --- drivers/gpio/gpiolib-sysfs.c | 16 +++++++++------- drivers/gpio/gpiolib.c | 4 ++-- drivers/gpio/gpiolib.h | 8 ++++---- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c index 767b79adb9a4..aeb73ef2955e 100644 --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c @@ -765,13 +765,14 @@ void gpiod_unexport(struct gpio_desc *desc) } EXPORT_SYMBOL_GPL(gpiod_unexport); -int gpiochip_export(struct gpio_chip *chip) +int gpiochip_sysfs_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) @@ -791,7 +792,7 @@ int gpiochip_export(struct gpio_chip *chip) return 0; } -void gpiochip_unexport(struct gpio_chip *chip) +void gpiochip_sysfs_unregister(struct gpio_chip *chip) { struct gpio_desc *desc; unsigned int i; @@ -836,15 +837,16 @@ static int __init gpiolib_sysfs_init(void) continue; /* - * TODO we yield gpio_lock here because gpiochip_export() - * acquires a mutex. This is unsafe and needs to be fixed. + * TODO we yield gpio_lock here because + * gpiochip_sysfs_register() acquires a mutex. This is unsafe + * and needs to be fixed. * * Also it would be nice to use gpiochip_find() here so we * can keep gpio_chips local to gpiolib.c, but the yield of * gpio_lock prevents us from doing this. */ spin_unlock_irqrestore(&gpio_lock, flags); - status = gpiochip_export(chip); + status = gpiochip_sysfs_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..2ce3df3504e6 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_sysfs_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_sysfs_unregister(chip); gpiochip_irqchip_remove(chip); diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h index 54bc5ec91398..efdd5ded4965 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_sysfs_register(struct gpio_chip *chip); +void gpiochip_sysfs_unregister(struct gpio_chip *chip); #else -static inline int gpiochip_export(struct gpio_chip *chip) +static inline int gpiochip_sysfs_register(struct gpio_chip *chip) { return 0; } -static inline void gpiochip_unexport(struct gpio_chip *chip) +static inline void gpiochip_sysfs_unregister(struct gpio_chip *chip) { }