usb: Increase quirk delay for USB devices
[pandora-kernel.git] / drivers / acpi / sysfs.c
index c538d0e..9b953d4 100644 (file)
@@ -173,7 +173,7 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp)
 {
        int result = 0;
 
-       if (!strncmp(val, "enable", strlen("enable") - 1)) {
+       if (!strncmp(val, "enable", strlen("enable"))) {
                result = acpi_debug_trace(trace_method_name, trace_debug_level,
                                          trace_debug_layer, 0);
                if (result)
@@ -181,7 +181,7 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp)
                goto exit;
        }
 
-       if (!strncmp(val, "disable", strlen("disable") - 1)) {
+       if (!strncmp(val, "disable", strlen("disable"))) {
                int name = 0;
                result = acpi_debug_trace((char *)&name, trace_debug_level,
                                          trace_debug_layer, 0);
@@ -489,23 +489,22 @@ static void acpi_gbl_event_handler(u32 event_type, acpi_handle device,
 static int get_status(u32 index, acpi_event_status *status,
                      acpi_handle *handle)
 {
-       int result = 0;
+       int result;
 
        if (index >= num_gpes + ACPI_NUM_FIXED_EVENTS)
-               goto end;
+               return -EINVAL;
 
        if (index < num_gpes) {
                result = acpi_get_gpe_device(index, handle);
                if (result) {
                        ACPI_EXCEPTION((AE_INFO, AE_NOT_FOUND,
                                        "Invalid GPE 0x%x\n", index));
-                       goto end;
+                       return result;
                }
                result = acpi_get_gpe_status(*handle, index, status);
        } else if (index < (num_gpes + ACPI_NUM_FIXED_EVENTS))
                result = acpi_get_event_status(index - num_gpes, status);
 
-end:
        return result;
 }
 
@@ -706,11 +705,23 @@ static void __exit interrupt_stats_exit(void)
        return;
 }
 
+static ssize_t
+acpi_show_profile(struct device *dev, struct device_attribute *attr,
+                 char *buf)
+{
+       return sprintf(buf, "%d\n", acpi_gbl_FADT.preferred_profile);
+}
+
+static const struct device_attribute pm_profile_attr =
+       __ATTR(pm_profile, S_IRUGO, acpi_show_profile, NULL);
+
 int __init acpi_sysfs_init(void)
 {
        int result;
 
        result = acpi_tables_sysfs_init();
-
+       if (result)
+               return result;
+       result = sysfs_create_file(acpi_kobj, &pm_profile_attr.attr);
        return result;
 }