]> Git Repo - J-linux.git/commitdiff
Merge branch 'acpi-messages'
authorRafael J. Wysocki <[email protected]>
Mon, 15 Feb 2021 16:04:53 +0000 (17:04 +0100)
committerRafael J. Wysocki <[email protected]>
Mon, 15 Feb 2021 16:04:53 +0000 (17:04 +0100)
* acpi-messages:
  ACPI: OSL: Clean up printing messages
  ACPI: OSL: Rework acpi_check_resource_conflict()
  ACPI: thermal: Clean up printing messages
  ACPI: video: Clean up printing messages
  ACPI: button: Clean up printing messages
  ACPI: battery: Clean up printing messages
  ACPI: AC: Clean up printing messages
  ACPI: bus: Drop ACPI_BUS_COMPONENT which is not used any more
  ACPI: utils: Clean up printing messages
  ACPI: scan: Clean up printing messages
  ACPI: bus: Clean up printing messages
  ACPI: PM: Clean up printing messages
  ACPI: power: Clean up printing messages

1  2 
drivers/acpi/power.c
drivers/acpi/scan.c

diff --combined drivers/acpi/power.c
index 3a7d0d703059adb7e3ebed1f265a4839454afd6e,962aec238d9dd10dd018f71a353dcae1f6936d9d..9b608b55d2b29545ccd32965bbdc5636af49252b
@@@ -21,6 -21,8 +21,8 @@@
   * may be shared by multiple devices.
   */
  
+ #define pr_fmt(fmt) "ACPI: PM: " fmt
  #include <linux/kernel.h>
  #include <linux/module.h>
  #include <linux/init.h>
@@@ -32,8 -34,6 +34,6 @@@
  #include "sleep.h"
  #include "internal.h"
  
- #define _COMPONENT                    ACPI_POWER_COMPONENT
- ACPI_MODULE_NAME("power");
  #define ACPI_POWER_CLASS              "power_resource"
  #define ACPI_POWER_DEVICE_NAME                "Power Resource"
  #define ACPI_POWER_RESOURCE_STATE_OFF 0x00
@@@ -181,9 -181,6 +181,6 @@@ static int acpi_power_get_state(acpi_ha
  {
        acpi_status status = AE_OK;
        unsigned long long sta = 0;
-       char node_name[5];
-       struct acpi_buffer buffer = { sizeof(node_name), node_name };
  
        if (!handle || !state)
                return -EINVAL;
        *state = (sta & 0x01)?ACPI_POWER_RESOURCE_STATE_ON:
                              ACPI_POWER_RESOURCE_STATE_OFF;
  
-       acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer);
-       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] is %s\n",
-                         node_name,
-                               *state ? "on" : "off"));
+       acpi_handle_debug(handle, "Power resource is %s\n",
+                         *state ? "on" : "off");
  
        return 0;
  }
@@@ -229,8 -223,7 +223,7 @@@ static int acpi_power_get_list_state(st
                        break;
        }
  
-       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource list is %s\n",
-                         cur_state ? "on" : "off"));
+       pr_debug("Power resource list is %s\n", cur_state ? "on" : "off");
  
        *state = cur_state;
        return 0;
@@@ -357,8 -350,7 +350,7 @@@ static int __acpi_power_on(struct acpi_
        if (ACPI_FAILURE(status))
                return -ENODEV;
  
-       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Power resource [%s] turned on\n",
-                         resource->name));
+       pr_debug("Power resource [%s] turned on\n", resource->name);
  
        /*
         * If there are other dependents on this power resource we need to
@@@ -383,9 -375,7 +375,7 @@@ static int acpi_power_on_unlocked(struc
        int result = 0;
  
        if (resource->ref_count++) {
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                                 "Power resource [%s] already on\n",
-                                 resource->name));
+               pr_debug("Power resource [%s] already on\n", resource->name);
        } else {
                result = __acpi_power_on(resource);
                if (result)
@@@ -413,8 -403,8 +403,8 @@@ static int __acpi_power_off(struct acpi
        if (ACPI_FAILURE(status))
                return -ENODEV;
  
-       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Power resource [%s] turned off\n",
-                         resource->name));
+       pr_debug("Power resource [%s] turned off\n", resource->name);
        return 0;
  }
  
@@@ -423,16 -413,12 +413,12 @@@ static int acpi_power_off_unlocked(stru
        int result = 0;
  
        if (!resource->ref_count) {
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                                 "Power resource [%s] already off\n",
-                                 resource->name));
+               pr_debug("Power resource [%s] already off\n", resource->name);
                return 0;
        }
  
        if (--resource->ref_count) {
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                                 "Power resource [%s] still in use\n",
-                                 resource->name));
+               pr_debug("Power resource [%s] still in use\n", resource->name);
        } else {
                result = __acpi_power_off(resource);
                if (result)
@@@ -672,7 -658,7 +658,7 @@@ int acpi_device_sleep_wake(struct acpi_
        if (ACPI_SUCCESS(status)) {
                return 0;
        } else if (status != AE_NOT_FOUND) {
-               printk(KERN_ERR PREFIX "_DSW execution failed\n");
+               acpi_handle_info(dev->handle, "_DSW execution failed\n");
                dev->wakeup.flags.valid = 0;
                return -ENODEV;
        }
        /* Execute _PSW */
        status = acpi_execute_simple_method(dev->handle, "_PSW", enable);
        if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {
-               printk(KERN_ERR PREFIX "_PSW execution failed\n");
+               acpi_handle_info(dev->handle, "_PSW execution failed\n");
                dev->wakeup.flags.valid = 0;
                return -ENODEV;
        }
@@@ -886,16 -872,15 +872,16 @@@ static void acpi_release_power_resource
        kfree(resource);
  }
  
 -static ssize_t acpi_power_in_use_show(struct device *dev,
 -                                    struct device_attribute *attr,
 -                                    char *buf) {
 +static ssize_t resource_in_use_show(struct device *dev,
 +                                  struct device_attribute *attr,
 +                                  char *buf)
 +{
        struct acpi_power_resource *resource;
  
        resource = to_power_resource(to_acpi_device(dev));
        return sprintf(buf, "%u\n", !!resource->ref_count);
  }
 -static DEVICE_ATTR(resource_in_use, 0444, acpi_power_in_use_show, NULL);
 +static DEVICE_ATTR_RO(resource_in_use);
  
  static void acpi_power_sysfs_remove(struct acpi_device *device)
  {
@@@ -961,8 -946,8 +947,8 @@@ int acpi_add_power_resource(acpi_handl
        if (result)
                goto err;
  
-       printk(KERN_INFO PREFIX "%s [%s] (%s)\n", acpi_device_name(device),
-              acpi_device_bid(device), state ? "on" : "off");
+       pr_info("%s [%s] (%s)\n", acpi_device_name(device),
+               acpi_device_bid(device), state ? "on" : "off");
  
        device->flags.match_driver = true;
        result = acpi_device_add(device, acpi_release_power_resource);
diff --combined drivers/acpi/scan.c
index cbdd2272d9823db4fd892d7d05718170aaa757db,1d7a02ee45e051aedee72f206ac938f5413ef165..a184529d8fa402f077790cbfa04094e7724c6c9a
@@@ -19,8 -19,6 +19,6 @@@
  
  #include "internal.h"
  
- #define _COMPONENT            ACPI_BUS_COMPONENT
- ACPI_MODULE_NAME("scan");
  extern struct acpi_device *acpi_root;
  
  #define ACPI_BUS_CLASS                        "system_bus"
@@@ -265,8 -263,7 +263,7 @@@ static int acpi_scan_hot_remove(struct 
                        return error;
        }
  
-       ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-               "Hot-removing device %s...\n", dev_name(&device->dev)));
+       acpi_handle_debug(handle, "Ejecting\n");
  
        acpi_bus_trim(device);
  
@@@ -829,7 -826,8 +826,8 @@@ static int acpi_bus_extract_wakeup_devi
        /* _PRW */
        status = acpi_evaluate_object(handle, "_PRW", NULL, &buffer);
        if (ACPI_FAILURE(status)) {
-               ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRW"));
+               acpi_handle_info(handle, "_PRW evaluation failed: %s\n",
+                                acpi_format_exception(status));
                return err;
        }
  
@@@ -934,7 -932,7 +932,7 @@@ static void acpi_bus_get_wakeup_device_
  
        err = acpi_bus_extract_wakeup_device_power_package(device);
        if (err) {
-               dev_err(&device->dev, "_PRW evaluation error: %d\n", err);
+               dev_err(&device->dev, "Unable to extract wakeup power resources");
                return;
        }
  
@@@ -1170,8 -1168,7 +1168,7 @@@ acpi_backlight_cap_match(acpi_handle ha
  
        if (acpi_has_method(handle, "_BCM") &&
            acpi_has_method(handle, "_BCL")) {
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found generic backlight "
-                                 "support\n"));
+               acpi_handle_debug(handle, "Found generic backlight support\n");
                *cap |= ACPI_VIDEO_BACKLIGHT;
                /* We have backlight support, no need to scan further */
                return AE_CTRL_TERMINATE;
@@@ -1662,17 -1659,15 +1659,15 @@@ static int acpi_add_single_object(struc
                                  acpi_handle handle, int type,
                                  unsigned long long sta)
  {
-       int result;
-       struct acpi_device *device;
-       struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        struct acpi_device_info *info = NULL;
+       struct acpi_device *device;
+       int result;
  
        if (handle != ACPI_ROOT_OBJECT && type == ACPI_BUS_TYPE_DEVICE)
                acpi_get_object_info(handle, &info);
  
        device = kzalloc(sizeof(struct acpi_device), GFP_KERNEL);
        if (!device) {
-               printk(KERN_ERR PREFIX "Memory allocation error\n");
                kfree(info);
                return -ENOMEM;
        }
  
        acpi_power_add_remove_device(device, true);
        acpi_device_add_finalize(device);
-       acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
-       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Added %s [%s] parent %s\n",
-               dev_name(&device->dev), (char *) buffer.pointer,
-               device->parent ? dev_name(&device->parent->dev) : "(null)"));
-       kfree(buffer.pointer);
+       acpi_handle_debug(handle, "Added as %s, parent %s\n",
+                         dev_name(&device->dev), device->parent ?
+                               dev_name(&device->parent->dev) : "(null)");
        *child = device;
        return 0;
  }
@@@ -2122,12 -2117,12 +2117,12 @@@ void acpi_walk_dep_device_list(acpi_han
        list_for_each_entry_safe(dep, tmp, &acpi_dep_list, node) {
                if (dep->supplier == handle) {
                        acpi_bus_get_device(dep->consumer, &adev);
 -                      if (!adev)
 -                              continue;
  
 -                      adev->dep_unmet--;
 -                      if (!adev->dep_unmet)
 -                              acpi_bus_attach(adev, true);
 +                      if (adev) {
 +                              adev->dep_unmet--;
 +                              if (!adev->dep_unmet)
 +                                      acpi_bus_attach(adev, true);
 +                      }
  
                        list_del(&dep->node);
                        kfree(dep);
This page took 0.086146 seconds and 4 git commands to generate.