git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.5.x5
[linux-2.6.git]
/
drivers
/
acpi
/
system.c
diff --git
a/drivers/acpi/system.c
b/drivers/acpi/system.c
index
9919e76
..
8925a6c
100644
(file)
--- a/
drivers/acpi/system.c
+++ b/
drivers/acpi/system.c
@@
-24,6
+24,7
@@
*/
#include <linux/proc_fs.h>
*/
#include <linux/proc_fs.h>
+#include <linux/seq_file.h>
#include <linux/init.h>
#include <asm/uaccess.h>
#include <linux/init.h>
#include <asm/uaccess.h>
@@
-48,35
+49,26
@@
extern FADT_DESCRIPTOR acpi_fadt;
-------------------------------------------------------------------------- */
static int
-------------------------------------------------------------------------- */
static int
-acpi_system_read_info (
- char *page,
- char **start,
- off_t off,
- int count,
- int *eof,
- void *data)
+acpi_system_read_info (struct seq_file *seq, void *offset)
{
{
- char *p = page;
- int size = 0;
-
ACPI_FUNCTION_TRACE("acpi_system_read_info");
ACPI_FUNCTION_TRACE("acpi_system_read_info");
- if (off != 0)
- goto end;
-
- p += sprintf(p, "version: %x\n", ACPI_CA_VERSION);
-
-end:
- size = (p - page);
- if (size <= off+count) *eof = 1;
- *start = page + off;
- size -= off;
- if (size>count) size = count;
- if (size<0) size = 0;
+ seq_printf(seq, "version: %x\n", ACPI_CA_VERSION);
+ return_VALUE(0);
+}
- return_VALUE(size);
+static int acpi_system_info_open_fs(struct inode *inode, struct file *file)
+{
+ return single_open(file, acpi_system_read_info, PDE(inode)->data);
}
}
+static struct file_operations acpi_system_info_ops = {
+ .open = acpi_system_info_open_fs,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = single_release,
+};
+
static ssize_t acpi_system_read_dsdt (struct file*, char __user *, size_t, loff_t*);
static struct file_operations acpi_system_dsdt_ops = {
static ssize_t acpi_system_read_dsdt (struct file*, char __user *, size_t, loff_t*);
static struct file_operations acpi_system_dsdt_ops = {
@@
-152,10
+144,13
@@
static int __init acpi_system_init (void)
/* 'info' [R] */
name = ACPI_SYSTEM_FILE_INFO;
/* 'info' [R] */
name = ACPI_SYSTEM_FILE_INFO;
- entry = create_proc_
read_
entry(name,
- S_IRUGO, acpi_root_dir
, acpi_system_read_info,NULL
);
+ entry = create_proc_entry(name,
+ S_IRUGO, acpi_root_dir);
if (!entry)
goto Error;
if (!entry)
goto Error;
+ else {
+ entry->proc_fops = &acpi_system_info_ops;
+ }
/* 'dsdt' [R] */
name = ACPI_SYSTEM_FILE_DSDT;
/* 'dsdt' [R] */
name = ACPI_SYSTEM_FILE_DSDT;