All of lore.kernel.org
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: linux-acpi@vger.kernel.org
Cc: Zhang Rui <rui.zhang@intel.com>, Len Brown <len.brown@intel.com>
Subject: [PATCH 16/20] ACPI power_resource: remove unused procfs I/F
Date: Sun, 15 Aug 2010 01:23:20 -0400	[thread overview]
Message-ID: <06af7eb043c02822072cea862fce1b7c74115e8f.1281849737.git.len.brown@intel.com> (raw)
In-Reply-To: <1281849804-7455-1-git-send-email-lenb@kernel.org>
In-Reply-To: <e96c4b081df0991a57b244f68c3955a9ea00bd0a.1281849737.git.len.brown@intel.com>

From: Zhang Rui <rui.zhang@intel.com>

Remove unused ACPI power procfs I/F.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/power.c |  128 +-------------------------------------------------
 1 files changed, 1 insertions(+), 127 deletions(-)

diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index f74d3b3..4fe5018 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -40,8 +40,6 @@
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/slab.h>
-#include <linux/proc_fs.h>
-#include <linux/seq_file.h>
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 #include "sleep.h"
@@ -64,7 +62,6 @@ module_param_named(power_nocheck, acpi_power_nocheck, bool, 000);
 static int acpi_power_add(struct acpi_device *device);
 static int acpi_power_remove(struct acpi_device *device, int type);
 static int acpi_power_resume(struct acpi_device *device);
-static int acpi_power_open_fs(struct inode *inode, struct file *file);
 
 static const struct acpi_device_id power_device_ids[] = {
 	{ACPI_POWER_HID, 0},
@@ -99,14 +96,6 @@ struct acpi_power_resource {
 
 static struct list_head acpi_power_resource_list;
 
-static const struct file_operations acpi_power_fops = {
-	.owner = THIS_MODULE,
-	.open = acpi_power_open_fs,
-	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
-
 /* --------------------------------------------------------------------------
                              Power Resource Management
    -------------------------------------------------------------------------- */
@@ -542,102 +531,6 @@ int acpi_power_transition(struct acpi_device *device, int state)
 }
 
 /* --------------------------------------------------------------------------
-                              FS Interface (/proc)
-   -------------------------------------------------------------------------- */
-
-static struct proc_dir_entry *acpi_power_dir;
-
-static int acpi_power_seq_show(struct seq_file *seq, void *offset)
-{
-	int count = 0;
-	int result = 0, state;
-	struct acpi_power_resource *resource = NULL;
-	struct list_head *node, *next;
-	struct acpi_power_reference *ref;
-
-
-	resource = seq->private;
-
-	if (!resource)
-		goto end;
-
-	result = acpi_power_get_state(resource->device->handle, &state);
-	if (result)
-		goto end;
-
-	seq_puts(seq, "state:                   ");
-	switch (state) {
-	case ACPI_POWER_RESOURCE_STATE_ON:
-		seq_puts(seq, "on\n");
-		break;
-	case ACPI_POWER_RESOURCE_STATE_OFF:
-		seq_puts(seq, "off\n");
-		break;
-	default:
-		seq_puts(seq, "unknown\n");
-		break;
-	}
-
-	mutex_lock(&resource->resource_lock);
-	list_for_each_safe(node, next, &resource->reference) {
-		ref = container_of(node, struct acpi_power_reference, node);
-		count++;
-	}
-	mutex_unlock(&resource->resource_lock);
-
-	seq_printf(seq, "system level:            S%d\n"
-		   "order:                   %d\n"
-		   "reference count:         %d\n",
-		   resource->system_level,
-		   resource->order, count);
-
-      end:
-	return 0;
-}
-
-static int acpi_power_open_fs(struct inode *inode, struct file *file)
-{
-	return single_open(file, acpi_power_seq_show, PDE(inode)->data);
-}
-
-static int acpi_power_add_fs(struct acpi_device *device)
-{
-	struct proc_dir_entry *entry = NULL;
-
-
-	if (!device)
-		return -EINVAL;
-
-	if (!acpi_device_dir(device)) {
-		acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
-						     acpi_power_dir);
-		if (!acpi_device_dir(device))
-			return -ENODEV;
-	}
-
-	/* 'status' [R] */
-	entry = proc_create_data(ACPI_POWER_FILE_STATUS,
-				 S_IRUGO, acpi_device_dir(device),
-				 &acpi_power_fops, acpi_driver_data(device));
-	if (!entry)
-		return -EIO;
-	return 0;
-}
-
-static int acpi_power_remove_fs(struct acpi_device *device)
-{
-
-	if (acpi_device_dir(device)) {
-		remove_proc_entry(ACPI_POWER_FILE_STATUS,
-				  acpi_device_dir(device));
-		remove_proc_entry(acpi_device_bid(device), acpi_power_dir);
-		acpi_device_dir(device) = NULL;
-	}
-
-	return 0;
-}
-
-/* --------------------------------------------------------------------------
                                 Driver Interface
    -------------------------------------------------------------------------- */
 
@@ -690,10 +583,6 @@ static int acpi_power_add(struct acpi_device *device)
 		break;
 	}
 
-	result = acpi_power_add_fs(device);
-	if (result)
-		goto end;
-
 	printk(KERN_INFO PREFIX "%s [%s] (%s)\n", acpi_device_name(device),
 	       acpi_device_bid(device), state ? "on" : "off");
 
@@ -715,8 +604,6 @@ static int acpi_power_remove(struct acpi_device *device, int type)
 
 	resource = acpi_driver_data(device);
 
-	acpi_power_remove_fs(device);
-
 	mutex_lock(&resource->resource_lock);
 	list_for_each_safe(node, next, &resource->reference) {
 		struct acpi_power_reference *ref = container_of(node, struct acpi_power_reference, node);
@@ -760,19 +647,6 @@ static int acpi_power_resume(struct acpi_device *device)
 
 int __init acpi_power_init(void)
 {
-	int result = 0;
-
 	INIT_LIST_HEAD(&acpi_power_resource_list);
-
-	acpi_power_dir = proc_mkdir(ACPI_POWER_CLASS, acpi_root_dir);
-	if (!acpi_power_dir)
-		return -ENODEV;
-
-	result = acpi_bus_register_driver(&acpi_power_driver);
-	if (result < 0) {
-		remove_proc_entry(ACPI_POWER_CLASS, acpi_root_dir);
-		return -ENODEV;
-	}
-
-	return 0;
+	return acpi_bus_register_driver(&acpi_power_driver);
 }
-- 
1.7.2.1.95.g3d045


  parent reply	other threads:[~2010-08-15  5:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-15  5:23 ACPI patches for 2.6.36.merge Len Brown
2010-08-15  5:23 ` [PATCH 01/20] ACPI / Sleep: Free NVS copy if suspending of devices fails Len Brown
2010-08-15  5:23   ` [PATCH 02/20] ACPI / Sleep: Rework enabling wakeup devices Len Brown
2010-08-15  5:23   ` [PATCH 03/20] ACPI / Wakeup: Simplify enabling of " Len Brown
2010-08-15  5:23   ` [PATCH 04/20] ACPI / Sleep: Consolidate suspend and hibernation routines Len Brown
2010-08-15  5:23   ` [PATCH 05/20] ACPI / Sleep: Drop acpi_suspend_finish() Len Brown
2010-08-15  5:23   ` [PATCH 06/20] ACPI: Add the check of ADR flag in course of finding ACPI handle for PCI device Len Brown
2010-08-15  5:23   ` [PATCH 07/20] ACPI / ACPICA: Fix reference counting problems with GPE handlers Len Brown
2010-08-15  5:23   ` [PATCH 08/20] ACPI, APEI, Fix a typo of error path of apei_resources_request Len Brown
2010-08-15  5:23   ` [PATCH 09/20] ACPI, APEI, Rename CPER and GHES severity constants Len Brown
2010-08-15  5:23   ` [PATCH 10/20] ACPI, APEI, Manage GHES as platform devices Len Brown
2010-08-15  5:23   ` [PATCH 11/20] ACPI, APEI, ERST debug support Len Brown
2010-08-15  5:23   ` [PATCH 12/20] ACPI: introduce drivers/acpi/debugfs.c Len Brown
2010-08-15  5:23   ` [PATCH 13/20] ACPI: introduce module parameter acpi.aml_debug_output Len Brown
2010-08-15  5:23   ` [PATCH 14/20] ACPI: introduce drivers/acpi/sysfs.c Len Brown
2010-08-15  5:23   ` [PATCH 15/20] ACPI: remove deprecated ACPI procfs I/F Len Brown
2010-08-15  5:23   ` Len Brown [this message]
2010-08-15  5:23   ` [PATCH 17/20] ACPI processor: " Len Brown
2010-08-15  5:23   ` [PATCH 18/20] ACPI video: make procfs I/F depend on CONFIG_ACPI_PROCFS Len Brown
2010-08-15  5:23   ` [PATCH 19/20] ACPI thermal: " Len Brown
2010-08-15  5:23   ` [PATCH 20/20] gcc-4.6: ACPI: fix unused but set variables in ACPI Len Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=06af7eb043c02822072cea862fce1b7c74115e8f.1281849737.git.len.brown@intel.com \
    --to=lenb@kernel.org \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.