From patchwork Fri Jan 4 22:02:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael Wysocki X-Patchwork-Id: 1934951 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id A59933FF0F for ; Fri, 4 Jan 2013 21:59:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755323Ab3ADV6z (ORCPT ); Fri, 4 Jan 2013 16:58:55 -0500 Received: from hydra.sisk.pl ([212.160.235.94]:60464 "EHLO hydra.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754865Ab3ADV6y (ORCPT ); Fri, 4 Jan 2013 16:58:54 -0500 Received: from vostro.rjw.lan (cms142.neoplus.adsl.tpnet.pl [83.31.146.142]) by hydra.sisk.pl (Postfix) with ESMTPSA id 7EF24E5383; Fri, 4 Jan 2013 22:59:45 +0100 (CET) From: "Rafael J. Wysocki" To: ACPI Devel Maling List Cc: LKML , Len Brown , Lv Zheng , Huang Ying Subject: [PATCH 3/6] ACPI / PM: Common string representations of device power states Date: Fri, 04 Jan 2013 23:02:18 +0100 Message-ID: <5284267.VuqCP1J6ZC@vostro.rjw.lan> User-Agent: KMail/4.9.5 (Linux/3.8.0-rc2+; KDE/4.9.5; x86_64; ; ) In-Reply-To: <2311196.icSMDvAsYg@vostro.rjw.lan> References: <2311196.icSMDvAsYg@vostro.rjw.lan> MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Rafael J. Wysocki The function returning string representations of ACPI device power states, state_string((), is now static, because it is only used internally in drivers/acpi/bus.c. However, it will be used outside of that file going forward, so rename it to acpi_power_state_string(), add a kerneldoc comment to it and add its header to acpi_bus.h. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/bus.c | 18 ++++++++++++------ include/acpi/acpi_bus.h | 1 + 2 files changed, 13 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux/drivers/acpi/bus.c =================================================================== --- linux.orig/drivers/acpi/bus.c +++ linux/drivers/acpi/bus.c @@ -182,7 +182,11 @@ EXPORT_SYMBOL(acpi_bus_get_private_data) Power Management -------------------------------------------------------------------------- */ -static const char *state_string(int state) +/** + * acpi_power_state_string - String representation of ACPI device power state. + * @state: ACPI device power state to return the string representation of. + */ +const char *acpi_power_state_string(int state) { switch (state) { case ACPI_STATE_D0: @@ -260,7 +264,7 @@ int acpi_device_get_power(struct acpi_de out: ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] power state is %s\n", - device->pnp.bus_id, state_string(*state))); + device->pnp.bus_id, acpi_power_state_string(*state))); return 0; } @@ -288,13 +292,13 @@ int acpi_device_set_power(struct acpi_de if (state == device->power.state) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at %s\n", - state_string(state))); + acpi_power_state_string(state))); return 0; } if (!device->power.states[state].flags.valid) { printk(KERN_WARNING PREFIX "Device does not support %s\n", - state_string(state)); + acpi_power_state_string(state)); return -ENODEV; } if (device->parent && (state < device->parent->power.state)) { @@ -362,12 +366,14 @@ int acpi_device_set_power(struct acpi_de if (result) printk(KERN_WARNING PREFIX "Device [%s] failed to transition to %s\n", - device->pnp.bus_id, state_string(state)); + device->pnp.bus_id, + acpi_power_state_string(state)); else { device->power.state = state; ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] transitioned to %s\n", - device->pnp.bus_id, state_string(state))); + device->pnp.bus_id, + acpi_power_state_string(state))); } return result; Index: linux/include/acpi/acpi_bus.h =================================================================== --- linux.orig/include/acpi/acpi_bus.h +++ linux/include/acpi/acpi_bus.h @@ -334,6 +334,7 @@ acpi_status acpi_bus_get_status_handle(a unsigned long long *sta); int acpi_bus_get_status(struct acpi_device *device); int acpi_bus_set_power(acpi_handle handle, int state); +const char *acpi_power_state_string(int state); int acpi_device_get_power(struct acpi_device *device, int *state); int acpi_device_set_power(struct acpi_device *device, int state); int acpi_bus_update_power(acpi_handle handle, int *state_p);