Merge branches 'acpi-tables', 'acpi-debug', 'acpi-doc' and 'acpi-misc'
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 14 Mar 2019 09:54:28 +0000 (10:54 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 14 Mar 2019 09:54:28 +0000 (10:54 +0100)
* acpi-tables:
  ACPI: tables: Simplify PPTT leaf node detection

* acpi-debug:
  ACPI: sysfs: Prevent get_status() from returning acpi_status

* acpi-doc:
  ACPI: Documentation: Fix path for acpidbg tool

* acpi-misc:
  ACPI / configfs: Mark local data structures static
  ACPI / configfs: Mark local functions static

Documentation/acpi/aml-debugger.txt
drivers/acpi/device_sysfs.c
drivers/acpi/pptt.c
drivers/acpi/sysfs.c

index e851cc5de63f29e8e8b89bc9c5f95e660f51f856..75ebeb64ab29a8806776f41901859495a1c52d64 100644 (file)
@@ -23,7 +23,7 @@ kernel.
 
    The resultant userspace tool binary is then located at:
 
-     tools/acpi/power/acpi/acpidbg/acpidbg
+     tools/power/acpi/acpidbg
 
    It can be installed to system directories by running "make install" (as a
    sufficiently privileged user).
@@ -35,7 +35,7 @@ kernel.
 
    # mount -t debugfs none /sys/kernel/debug
    # modprobe acpi_dbg
-   # tools/acpi/power/acpi/acpidbg/acpidbg
+   # tools/power/acpi/acpidbg
 
    That spawns the interactive AML debugger environment where you can execute
    debugger commands.
index 545e91420cded88ac3b2621d97b1f1176696f348..8940054d6250f92c56a82f637d0a326256b4eed8 100644 (file)
@@ -202,11 +202,15 @@ static int create_of_modalias(struct acpi_device *acpi_dev, char *modalias,
 {
        struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER };
        const union acpi_object *of_compatible, *obj;
+       acpi_status status;
        int len, count;
        int i, nval;
        char *c;
 
-       acpi_get_name(acpi_dev->handle, ACPI_SINGLE_NAME, &buf);
+       status = acpi_get_name(acpi_dev->handle, ACPI_SINGLE_NAME, &buf);
+       if (ACPI_FAILURE(status))
+               return -ENODEV;
+
        /* DT strings are all in lower case */
        for (c = buf.pointer; *c != '\0'; c++)
                *c = tolower(*c);
index ad31c50de3be8582f483057efcae8d2476552f45..065c4fc245d117ff84b938790c232bbf555c0cb8 100644 (file)
@@ -209,6 +209,9 @@ static int acpi_pptt_leaf_node(struct acpi_table_header *table_hdr,
        struct acpi_pptt_processor *cpu_node;
        u32 proc_sz;
 
+       if (table_hdr->revision > 1)
+               return (node->flags & ACPI_PPTT_ACPI_LEAF_NODE);
+
        table_end = (unsigned long)table_hdr + table_hdr->length;
        node_entry = ACPI_PTR_DIFF(node, table_hdr);
        entry = ACPI_ADD_PTR(struct acpi_subtable_header, table_hdr,
index 41324f0b1bee26b73a55ddc027fb8f52928a31a5..fa76f5e41b5ca419978c804e8df8d8b2b714e329 100644 (file)
@@ -648,26 +648,29 @@ static void acpi_global_event_handler(u32 event_type, acpi_handle device,
        }
 }
 
-static int get_status(u32 index, acpi_event_status *status,
+static int get_status(u32 index, acpi_event_status *ret,
                      acpi_handle *handle)
 {
-       int result;
+       acpi_status status;
 
        if (index >= num_gpes + ACPI_NUM_FIXED_EVENTS)
                return -EINVAL;
 
        if (index < num_gpes) {
-               result = acpi_get_gpe_device(index, handle);
-               if (result) {
+               status = acpi_get_gpe_device(index, handle);
+               if (ACPI_FAILURE(status)) {
                        ACPI_EXCEPTION((AE_INFO, AE_NOT_FOUND,
                                        "Invalid GPE 0x%x", index));
-                       return result;
+                       return -ENXIO;
                }
-               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);
+               status = acpi_get_gpe_status(*handle, index, ret);
+       } else {
+               status = acpi_get_event_status(index - num_gpes, ret);
+       }
+       if (ACPI_FAILURE(status))
+               return -EIO;
 
-       return result;
+       return 0;
 }
 
 static ssize_t counter_show(struct kobject *kobj,