From patchwork Wed Oct 10 22:21:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 12159 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 0C96E23EFB for ; Wed, 10 Oct 2012 22:21:44 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id B96A3A1859A for ; Wed, 10 Oct 2012 22:21:43 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so1864249iej.11 for ; Wed, 10 Oct 2012 15:21:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=NnCfSaiyXnnZbieIy1QYpvwBS00w/9FcDnmQXj7+6hw=; b=Md9EWI/qC0k/LkwLZ5x0RHpzchpnQtWSNLGXtwo55n2qte83Ah74SHjqitBWXekFks ihVxFGleSdrRyvRFGBZQLmYCpN98qpKqV384CErFXyKB+PpuATxPC1RKMzevcab/eoji QewuOp5/wd1aZeXCYLsnJqoyAlwedwiqfyXEQwtFR0A22HzNNX5FEO5Xrz+6LGeYT7YM eTXHIgxB8BvfB6NkhUkEGCsKEdDz1xUrQUyH2IlJ1UdCmNlJh8vmBzm+kBnMfFlnFvSe GWYc/ZDW7IqWYHllrs7QfAyqrNpi3idHZ9bo8ZTM34akS0Hh+GFYIMraEfMDh9RkCpsS nz7Q== Received: by 10.50.87.134 with SMTP id ay6mr6781548igb.70.1349907703386; Wed, 10 Oct 2012 15:21:43 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp302330igt; Wed, 10 Oct 2012 15:21:42 -0700 (PDT) Received: by 10.180.78.102 with SMTP id a6mr15960501wix.20.1349907701971; Wed, 10 Oct 2012 15:21:41 -0700 (PDT) Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id y82si3153655wep.13.2012.10.10.15.21.41 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 10 Oct 2012 15:21:41 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: by mail-we0-f178.google.com with SMTP id r6so747347wey.37 for ; Wed, 10 Oct 2012 15:21:41 -0700 (PDT) Received: by 10.216.141.148 with SMTP id g20mr9325030wej.106.1349907701444; Wed, 10 Oct 2012 15:21:41 -0700 (PDT) Received: from localhost.localdomain (AToulouse-651-1-105-241.w109-222.abo.wanadoo.fr. [109.222.192.241]) by mx.google.com with ESMTPS id cu1sm32250748wib.6.2012.10.10.15.21.39 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 10 Oct 2012 15:21:40 -0700 (PDT) From: Daniel Lezcano To: rjw@sisk.pl Cc: linux-pm@vger.kernel.org, linaro-dev@lists.linaro.org, patches@linaro.org Subject: [PATCH 3/4] cpuidle - sysfs : change function name Date: Thu, 11 Oct 2012 00:21:30 +0200 Message-Id: <1349907691-6002-4-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1349907691-6002-1-git-send-email-daniel.lezcano@linaro.org> References: <1349907691-6002-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQntlgPJr+nf5cT3DpuFT7IYA2q7MAi2wquvwj2o2Yd6W+6S2a/DY+TwoVl0PM5EMpLZrYsd The next patchset providing the multiple drivers support will add to the per cpu sysfs driver. In order to prepare the place this patch creates a single entry function when a cpuidle device is added or removed. Signed-off-by: Daniel Lezcano --- drivers/cpuidle/cpuidle.c | 7 ++++--- drivers/cpuidle/cpuidle.h | 4 ++-- drivers/cpuidle/sysfs.c | 26 ++++++++++++++++++++++---- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 7cf8388..847500b 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -331,7 +331,8 @@ int cpuidle_enable_device(struct cpuidle_device *dev) poll_idle_init(drv); - if ((ret = cpuidle_add_state_sysfs(dev))) + ret = cpuidle_add_device_sysfs(dev); + if (ret) return ret; if (cpuidle_curr_governor->enable && @@ -352,7 +353,7 @@ int cpuidle_enable_device(struct cpuidle_device *dev) return 0; fail_sysfs: - cpuidle_remove_state_sysfs(dev); + cpuidle_remove_device_sysfs(dev); return ret; } @@ -378,7 +379,7 @@ void cpuidle_disable_device(struct cpuidle_device *dev) if (cpuidle_curr_governor->disable) cpuidle_curr_governor->disable(cpuidle_get_driver(), dev); - cpuidle_remove_state_sysfs(dev); + cpuidle_remove_device_sysfs(dev); enabled_devices--; } diff --git a/drivers/cpuidle/cpuidle.h b/drivers/cpuidle/cpuidle.h index a5bbd1c..1ba1168 100644 --- a/drivers/cpuidle/cpuidle.h +++ b/drivers/cpuidle/cpuidle.h @@ -25,8 +25,8 @@ extern int cpuidle_switch_governor(struct cpuidle_governor *gov); /* sysfs */ extern int cpuidle_add_interface(struct device *dev); extern void cpuidle_remove_interface(struct device *dev); -extern int cpuidle_add_state_sysfs(struct cpuidle_device *device); -extern void cpuidle_remove_state_sysfs(struct cpuidle_device *device); +extern int cpuidle_add_device_sysfs(struct cpuidle_device *device); +extern void cpuidle_remove_device_sysfs(struct cpuidle_device *device); extern int cpuidle_add_sysfs(struct cpuidle_device *dev); extern void cpuidle_remove_sysfs(struct cpuidle_device *dev); diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c index ed87399..c25e26e 100644 --- a/drivers/cpuidle/sysfs.c +++ b/drivers/cpuidle/sysfs.c @@ -356,10 +356,10 @@ static inline void cpuidle_free_state_kobj(struct cpuidle_device *device, int i) } /** - * cpuidle_add_driver_sysfs - adds driver-specific sysfs attributes + * cpuidle_add_state_sysfs - adds cpuidle states sysfs attributes * @device: the target device */ -int cpuidle_add_state_sysfs(struct cpuidle_device *device) +static int cpuidle_add_state_sysfs(struct cpuidle_device *device) { int i, ret = -ENOMEM; struct cpuidle_state_kobj *kobj; @@ -393,10 +393,10 @@ error_state: } /** - * cpuidle_remove_driver_sysfs - removes driver-specific sysfs attributes + * cpuidle_remove_driver_sysfs - removes the cpuidle states sysfs attributes * @device: the target device */ -void cpuidle_remove_state_sysfs(struct cpuidle_device *device) +static void cpuidle_remove_state_sysfs(struct cpuidle_device *device) { int i; @@ -405,6 +405,24 @@ void cpuidle_remove_state_sysfs(struct cpuidle_device *device) } /** + * cpuidle_add_device_sysfs - adds device specific sysfs attributes + * @device: the target device + */ +int cpuidle_add_device_sysfs(struct cpuidle_device *device) +{ + return cpuidle_add_state_sysfs(device); +} + +/** + * cpuidle_remove_device_sysfs : removes device specific sysfs attributes + * @device : the target device + */ +void cpuidle_remove_device_sysfs(struct cpuidle_device *device) +{ + cpuidle_remove_state_sysfs(device); +} + +/** * cpuidle_add_sysfs - creates a sysfs instance for the target device * @dev: the target device */