]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/firmware/dcdbas.c
ACPI: replace ACPI_DEBUG_PRINT((ACPI_DB_ERROR, ...) with printk
[linux-2.6-omap-h63xx.git] / drivers / firmware / dcdbas.c
index 25918f7dfd0fe73884ff86101ed90c04346e00cb..50a071f1c945c0c3d8079ffdf713c577315a8415 100644 (file)
@@ -152,20 +152,11 @@ static ssize_t smi_data_read(struct kobject *kobj,
                             struct bin_attribute *bin_attr,
                             char *buf, loff_t pos, size_t count)
 {
-       size_t max_read;
        ssize_t ret;
 
        mutex_lock(&smi_data_lock);
-
-       if (pos >= smi_data_buf_size) {
-               ret = 0;
-               goto out;
-       }
-
-       max_read = smi_data_buf_size - pos;
-       ret = min(max_read, count);
-       memcpy(buf, smi_data_buf + pos, ret);
-out:
+       ret = memory_read_from_buffer(buf, count, &pos, smi_data_buf,
+                                       smi_data_buf_size);
        mutex_unlock(&smi_data_lock);
        return ret;
 }