X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Facpi%2Fsystem.c;h=8925a6ca5f87561707f00b7fd8d2219d1f317b71;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=9919e76d7d49ccde3585b14a1263ec0d0e5b5758;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c index 9919e76d7..8925a6ca5 100644 --- a/drivers/acpi/system.c +++ b/drivers/acpi/system.c @@ -24,6 +24,7 @@ */ #include +#include #include #include @@ -48,35 +49,26 @@ extern FADT_DESCRIPTOR acpi_fadt; -------------------------------------------------------------------------- */ 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"); - 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 = { @@ -152,10 +144,13 @@ static int __init acpi_system_init (void) /* '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; + else { + entry->proc_fops = &acpi_system_info_ops; + } /* 'dsdt' [R] */ name = ACPI_SYSTEM_FILE_DSDT;