Commit 4be44fcd authored by Len Brown's avatar Len Brown

[ACPI] Lindent all ACPI files

Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent c65ade4d
This diff is collapsed.
......@@ -20,7 +20,7 @@ static int __init check_bridge(int vendor, int device)
void __init check_acpi_pci(void)
{
int num,slot,func;
int num, slot, func;
/* Assume the machine supports type 1. If not it will
always read ffffffff and should not have any side effect. */
......@@ -31,7 +31,7 @@ void __init check_acpi_pci(void)
for (func = 0; func < 8; func++) {
u32 class;
u32 vendor;
class = read_pci_config(num,slot,func,
class = read_pci_config(num, slot, func,
PCI_CLASS_REVISION);
if (class == 0xffffffff)
break;
......@@ -42,7 +42,7 @@ void __init check_acpi_pci(void)
vendor = read_pci_config(num, slot, func,
PCI_VENDOR_ID);
if (check_bridge(vendor&0xffff, vendor >> 16))
if (check_bridge(vendor & 0xffff, vendor >> 16))
return;
}
......
......@@ -20,12 +20,13 @@ extern void zap_low_mappings(void);
extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long));
static void init_low_mapping(pgd_t *pgd, int pgd_limit)
static void init_low_mapping(pgd_t * pgd, int pgd_limit)
{
int pgd_ofs = 0;
while ((pgd_ofs < pgd_limit) && (pgd_ofs + USER_PTRS_PER_PGD < PTRS_PER_PGD)) {
set_pgd(pgd, *(pgd+USER_PTRS_PER_PGD));
while ((pgd_ofs < pgd_limit)
&& (pgd_ofs + USER_PTRS_PER_PGD < PTRS_PER_PGD)) {
set_pgd(pgd, *(pgd + USER_PTRS_PER_PGD));
pgd_ofs++, pgd++;
}
flush_tlb_all();
......@@ -37,12 +38,13 @@ static void init_low_mapping(pgd_t *pgd, int pgd_limit)
* Create an identity mapped page table and copy the wakeup routine to
* low memory.
*/
int acpi_save_state_mem (void)
int acpi_save_state_mem(void)
{
if (!acpi_wakeup_address)
return 1;
init_low_mapping(swapper_pg_dir, USER_PTRS_PER_PGD);
memcpy((void *) acpi_wakeup_address, &wakeup_start, &wakeup_end - &wakeup_start);
memcpy((void *)acpi_wakeup_address, &wakeup_start,
&wakeup_end - &wakeup_start);
acpi_copy_wakeup_routine(acpi_wakeup_address);
return 0;
......@@ -51,7 +53,7 @@ int acpi_save_state_mem (void)
/*
* acpi_restore_state - undo effects of acpi_save_state_mem
*/
void acpi_restore_state_mem (void)
void acpi_restore_state_mem(void)
{
zap_low_mappings();
}
......@@ -67,7 +69,8 @@ void acpi_restore_state_mem (void)
void __init acpi_reserve_bootmem(void)
{
if ((&wakeup_end - &wakeup_start) > PAGE_SIZE) {
printk(KERN_ERR "ACPI: Wakeup code way too big, S3 disabled.\n");
printk(KERN_ERR
"ACPI: Wakeup code way too big, S3 disabled.\n");
return;
}
......@@ -90,10 +93,8 @@ static int __init acpi_sleep_setup(char *str)
return 1;
}
__setup("acpi_sleep=", acpi_sleep_setup);
static __init int reset_videomode_after_s3(struct dmi_system_id *d)
{
acpi_video_flags |= 2;
......@@ -108,7 +109,7 @@ static __initdata struct dmi_system_id acpisleep_dmi_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),
},
},
{ }
{}
};
static int __init acpisleep_dmi_init(void)
......
......@@ -30,7 +30,7 @@ struct acpi_vendor_info {
acpi_status
acpi_vendor_resource_match(struct acpi_resource *resource, void *context)
{
struct acpi_vendor_info *info = (struct acpi_vendor_info *) context;
struct acpi_vendor_info *info = (struct acpi_vendor_info *)context;
struct acpi_resource_vendor *vendor;
struct acpi_vendor_descriptor *descriptor;
u32 length;
......@@ -38,8 +38,8 @@ acpi_vendor_resource_match(struct acpi_resource *resource, void *context)
if (resource->id != ACPI_RSTYPE_VENDOR)
return AE_OK;
vendor = (struct acpi_resource_vendor *) &resource->data;
descriptor = (struct acpi_vendor_descriptor *) vendor->reserved;
vendor = (struct acpi_resource_vendor *)&resource->data;
descriptor = (struct acpi_vendor_descriptor *)vendor->reserved;
if (vendor->length <= sizeof(*info->descriptor) ||
descriptor->guid_id != info->descriptor->guid_id ||
efi_guidcmp(descriptor->guid, info->descriptor->guid))
......@@ -50,21 +50,24 @@ acpi_vendor_resource_match(struct acpi_resource *resource, void *context)
if (!info->data)
return AE_NO_MEMORY;
memcpy(info->data, vendor->reserved + sizeof(struct acpi_vendor_descriptor), length);
memcpy(info->data,
vendor->reserved + sizeof(struct acpi_vendor_descriptor),
length);
info->length = length;
return AE_CTRL_TERMINATE;
}
acpi_status
acpi_find_vendor_resource(acpi_handle obj, struct acpi_vendor_descriptor *id,
u8 **data, u32 *length)
acpi_find_vendor_resource(acpi_handle obj, struct acpi_vendor_descriptor * id,
u8 ** data, u32 * length)
{
struct acpi_vendor_info info;
info.descriptor = id;
info.data = NULL;
acpi_walk_resources(obj, METHOD_NAME__CRS, acpi_vendor_resource_match, &info);
acpi_walk_resources(obj, METHOD_NAME__CRS, acpi_vendor_resource_match,
&info);
if (!info.data)
return AE_NOT_FOUND;
......@@ -75,17 +78,19 @@ acpi_find_vendor_resource(acpi_handle obj, struct acpi_vendor_descriptor *id,
struct acpi_vendor_descriptor hp_ccsr_descriptor = {
.guid_id = 2,
.guid = EFI_GUID(0x69e9adf9, 0x924f, 0xab5f, 0xf6, 0x4a, 0x24, 0xd2, 0x01, 0x37, 0x0e, 0xad)
.guid =
EFI_GUID(0x69e9adf9, 0x924f, 0xab5f, 0xf6, 0x4a, 0x24, 0xd2, 0x01,
0x37, 0x0e, 0xad)
};
acpi_status
hp_acpi_csr_space(acpi_handle obj, u64 *csr_base, u64 *csr_length)
acpi_status hp_acpi_csr_space(acpi_handle obj, u64 * csr_base, u64 * csr_length)
{
acpi_status status;
u8 *data;
u32 length;
status = acpi_find_vendor_resource(obj, &hp_ccsr_descriptor, &data, &length);
status =
acpi_find_vendor_resource(obj, &hp_ccsr_descriptor, &data, &length);
if (ACPI_FAILURE(status) || length != 16)
return AE_NOT_FOUND;
......
This diff is collapsed.
......@@ -47,7 +47,6 @@
#include <asm/proto.h>
#include <asm/tlbflush.h>
/* --------------------------------------------------------------------------
Low-Level Sleep Support
-------------------------------------------------------------------------- */
......@@ -77,11 +76,12 @@ static void init_low_mapping(void)
* Create an identity mapped page table and copy the wakeup routine to
* low memory.
*/
int acpi_save_state_mem (void)
int acpi_save_state_mem(void)
{
init_low_mapping();
memcpy((void *) acpi_wakeup_address, &wakeup_start, &wakeup_end - &wakeup_start);
memcpy((void *)acpi_wakeup_address, &wakeup_start,
&wakeup_end - &wakeup_start);
acpi_copy_wakeup_routine(acpi_wakeup_address);
return 0;
......@@ -90,7 +90,7 @@ int acpi_save_state_mem (void)
/*
* acpi_restore_state
*/
void acpi_restore_state_mem (void)
void acpi_restore_state_mem(void)
{
set_pgd(pgd_offset(current->mm, 0UL), low_ptr);
flush_tlb_all();
......@@ -108,7 +108,8 @@ void __init acpi_reserve_bootmem(void)
{
acpi_wakeup_address = (unsigned long)alloc_bootmem_low(PAGE_SIZE);
if ((&wakeup_end - &wakeup_start) > PAGE_SIZE)
printk(KERN_CRIT "ACPI: Wakeup code way too big, will crash on attempt to suspend\n");
printk(KERN_CRIT
"ACPI: Wakeup code way too big, will crash on attempt to suspend\n");
}
static int __init acpi_sleep_setup(char *str)
......@@ -127,6 +128,8 @@ static int __init acpi_sleep_setup(char *str)
__setup("acpi_sleep=", acpi_sleep_setup);
#endif /*CONFIG_ACPI_SLEEP*/
#endif /*CONFIG_ACPI_SLEEP */
void acpi_pci_link_exit(void) {}
void acpi_pci_link_exit(void)
{
}
......@@ -32,7 +32,6 @@
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#define ACPI_AC_COMPONENT 0x00020000
#define ACPI_AC_CLASS "ac_adapter"
#define ACPI_AC_HID "ACPI0003"
......@@ -45,14 +44,14 @@
#define ACPI_AC_STATUS_UNKNOWN 0xFF
#define _COMPONENT ACPI_AC_COMPONENT
ACPI_MODULE_NAME ("acpi_ac")
ACPI_MODULE_NAME("acpi_ac")
MODULE_AUTHOR("Paul Diefenbaugh");
MODULE_AUTHOR("Paul Diefenbaugh");
MODULE_DESCRIPTION(ACPI_AC_DRIVER_NAME);
MODULE_LICENSE("GPL");
static int acpi_ac_add (struct acpi_device *device);
static int acpi_ac_remove (struct acpi_device *device, int type);
static int acpi_ac_add(struct acpi_device *device);
static int acpi_ac_remove(struct acpi_device *device, int type);
static int acpi_ac_open_fs(struct inode *inode, struct file *file);
static struct acpi_driver acpi_ac_driver = {
......@@ -81,9 +80,7 @@ static struct file_operations acpi_ac_fops = {
AC Adapter Management
-------------------------------------------------------------------------- */
static int
acpi_ac_get_state (
struct acpi_ac *ac)
static int acpi_ac_get_state(struct acpi_ac *ac)
{
acpi_status status = AE_OK;
......@@ -103,7 +100,6 @@ acpi_ac_get_state (
return_VALUE(0);
}
/* --------------------------------------------------------------------------
FS Interface (/proc)
-------------------------------------------------------------------------- */
......@@ -112,7 +108,7 @@ static struct proc_dir_entry *acpi_ac_dir;
static int acpi_ac_seq_show(struct seq_file *seq, void *offset)
{
struct acpi_ac *ac = (struct acpi_ac *) seq->private;
struct acpi_ac *ac = (struct acpi_ac *)seq->private;
ACPI_FUNCTION_TRACE("acpi_ac_seq_show");
......@@ -145,9 +141,7 @@ static int acpi_ac_open_fs(struct inode *inode, struct file *file)
return single_open(file, acpi_ac_seq_show, PDE(inode)->data);
}
static int
acpi_ac_add_fs (
struct acpi_device *device)
static int acpi_ac_add_fs(struct acpi_device *device)
{
struct proc_dir_entry *entry = NULL;
......@@ -177,16 +171,12 @@ acpi_ac_add_fs (
return_VALUE(0);
}
static int
acpi_ac_remove_fs (
struct acpi_device *device)
static int acpi_ac_remove_fs(struct acpi_device *device)
{
ACPI_FUNCTION_TRACE("acpi_ac_remove_fs");
if (acpi_device_dir(device)) {
remove_proc_entry(ACPI_AC_FILE_STATE,
acpi_device_dir(device));
remove_proc_entry(ACPI_AC_FILE_STATE, acpi_device_dir(device));
remove_proc_entry(acpi_device_bid(device), acpi_ac_dir);
acpi_device_dir(device) = NULL;
......@@ -195,18 +185,13 @@ acpi_ac_remove_fs (
return_VALUE(0);
}
/* --------------------------------------------------------------------------
Driver Model
-------------------------------------------------------------------------- */
static void
acpi_ac_notify (
acpi_handle handle,
u32 event,
void *data)
static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
{
struct acpi_ac *ac = (struct acpi_ac *) data;
struct acpi_ac *ac = (struct acpi_ac *)data;
struct acpi_device *device = NULL;
ACPI_FUNCTION_TRACE("acpi_ac_notify");
......@@ -231,10 +216,7 @@ acpi_ac_notify (
return_VOID;
}
static int
acpi_ac_add (
struct acpi_device *device)
static int acpi_ac_add(struct acpi_device *device)
{
int result = 0;
acpi_status status = AE_OK;
......@@ -264,7 +246,8 @@ acpi_ac_add (
goto end;
status = acpi_install_notify_handler(ac->handle,
ACPI_DEVICE_NOTIFY, acpi_ac_notify, ac);
ACPI_DEVICE_NOTIFY, acpi_ac_notify,
ac);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error installing notify handler\n"));
......@@ -274,9 +257,9 @@ acpi_ac_add (
printk(KERN_INFO PREFIX "%s [%s] (%s)\n",
acpi_device_name(device), acpi_device_bid(device),
ac->state?"on-line":"off-line");
ac->state ? "on-line" : "off-line");
end:
end:
if (result) {
acpi_ac_remove_fs(device);
kfree(ac);
......@@ -285,11 +268,7 @@ acpi_ac_add (
return_VALUE(result);
}
static int
acpi_ac_remove (
struct acpi_device *device,
int type)
static int acpi_ac_remove(struct acpi_device *device, int type)
{
acpi_status status = AE_OK;
struct acpi_ac *ac = NULL;
......@@ -299,7 +278,7 @@ acpi_ac_remove (
if (!device || !acpi_driver_data(device))
return_VALUE(-EINVAL);
ac = (struct acpi_ac *) acpi_driver_data(device);
ac = (struct acpi_ac *)acpi_driver_data(device);
status = acpi_remove_notify_handler(ac->handle,
ACPI_DEVICE_NOTIFY, acpi_ac_notify);
......@@ -314,9 +293,7 @@ acpi_ac_remove (
return_VALUE(0);
}
static int __init
acpi_ac_init (void)
static int __init acpi_ac_init(void)
{
int result = 0;
......@@ -336,9 +313,7 @@ acpi_ac_init (void)
return_VALUE(0);
}
static void __exit
acpi_ac_exit (void)
static void __exit acpi_ac_exit(void)
{
ACPI_FUNCTION_TRACE("acpi_ac_exit");
......@@ -349,6 +324,5 @@ acpi_ac_exit (void)
return_VOID;
}
module_init(acpi_ac_init);
module_exit(acpi_ac_exit);
......@@ -32,7 +32,6 @@
#include <linux/memory_hotplug.h>
#include <acpi/acpi_drivers.h>
#define ACPI_MEMORY_DEVICE_COMPONENT 0x08000000UL
#define ACPI_MEMORY_DEVICE_CLASS "memory"
#define ACPI_MEMORY_DEVICE_HID "PNP0C80"
......@@ -41,8 +40,8 @@
#define _COMPONENT ACPI_MEMORY_DEVICE_COMPONENT
ACPI_MODULE_NAME ("acpi_memory")
MODULE_AUTHOR("Naveen B S <naveen.b.s@intel.com>");
ACPI_MODULE_NAME("acpi_memory")
MODULE_AUTHOR("Naveen B S <naveen.b.s@intel.com>");
MODULE_DESCRIPTION(ACPI_MEMORY_DEVICE_DRIVER_NAME);
MODULE_LICENSE("GPL");
......@@ -56,8 +55,8 @@ MODULE_LICENSE("GPL");
#define MEMORY_POWER_ON_STATE 1
#define MEMORY_POWER_OFF_STATE 2
static int acpi_memory_device_add (struct acpi_device *device);
static int acpi_memory_device_remove (struct acpi_device *device, int type);
static int acpi_memory_device_add(struct acpi_device *device);
static int acpi_memory_device_remove(struct acpi_device *device, int type);
static struct acpi_driver acpi_memory_device_driver = {
.name = ACPI_MEMORY_DEVICE_DRIVER_NAME,
......@@ -73,17 +72,16 @@ struct acpi_memory_device {
acpi_handle handle;
unsigned int state; /* State of the memory device */
unsigned short cache_attribute; /* memory cache attribute */
unsigned short read_write_attribute;/* memory read/write attribute */
unsigned short read_write_attribute; /* memory read/write attribute */
u64 start_addr; /* Memory Range start physical addr */
u64 end_addr; /* Memory Range end physical addr */
};
static int
acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
{
acpi_status status;
struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
struct acpi_resource *resource = NULL;
struct acpi_resource_address64 address64;
......@@ -94,7 +92,7 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
if (ACPI_FAILURE(status))
return_VALUE(-EINVAL);
resource = (struct acpi_resource *) buffer.pointer;
resource = (struct acpi_resource *)buffer.pointer;
status = acpi_resource_to_address64(resource, &address64);
if (ACPI_SUCCESS(status)) {
if (address64.resource_type == ACPI_MEMORY_RANGE) {
......@@ -128,8 +126,7 @@ acpi_memory_get_device(acpi_handle handle,
status = acpi_get_parent(handle, &phandle);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error in acpi_get_parent\n"));
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error in acpi_get_parent\n"));
return_VALUE(-EINVAL);
}
......@@ -147,23 +144,21 @@ acpi_memory_get_device(acpi_handle handle,
*/
status = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error in acpi_bus_add\n"));
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error in acpi_bus_add\n"));
return_VALUE(-EINVAL);
}
end:
end:
*mem_device = acpi_driver_data(device);
if (!(*mem_device)) {
printk(KERN_ERR "\n driver data not found" );
printk(KERN_ERR "\n driver data not found");
return_VALUE(-ENODEV);
}
return_VALUE(0);
}
static int
acpi_memory_check_device(struct acpi_memory_device *mem_device)
static int acpi_memory_check_device(struct acpi_memory_device *mem_device)
{
unsigned long current_status;
......@@ -185,8 +180,7 @@ acpi_memory_check_device(struct acpi_memory_device *mem_device)
return_VALUE(0);
}
static int
acpi_memory_enable_device(struct acpi_memory_device *mem_device)
static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
{
int result;
......@@ -209,8 +203,7 @@ acpi_memory_enable_device(struct acpi_memory_device *mem_device)
(mem_device->end_addr - mem_device->start_addr) + 1,
mem_device->read_write_attribute);
if (result) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"\nadd_memory failed\n"));
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "\nadd_memory failed\n"));
mem_device->state = MEMORY_INVALID_STATE;
return result;
}
......@@ -218,8 +211,7 @@ acpi_memory_enable_device(struct acpi_memory_device *mem_device)
return result;
}
static int
acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
{
acpi_status status;
struct acpi_object_list arg_list;
......@@ -237,7 +229,7 @@ acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
"_EJ0", &arg_list, NULL);
/* Return on _EJ0 failure */
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,"_EJ0 failed.\n"));
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "_EJ0 failed.\n"));
return_VALUE(-ENODEV);
}
......@@ -254,8 +246,7 @@ acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
return_VALUE(0);
}
static int
acpi_memory_disable_device(struct acpi_memory_device *mem_device)
static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
{
int result;
u64 start = mem_device->start_addr;
......@@ -288,8 +279,7 @@ acpi_memory_disable_device(struct acpi_memory_device *mem_device)
return result;
}
static void
acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
{
struct acpi_memory_device *mem_device;
struct acpi_device *device;
......@@ -355,8 +345,7 @@ acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
return_VOID;
}
static int
acpi_memory_device_add(struct acpi_device *device)
static int acpi_memory_device_add(struct acpi_device *device)
{
int result;
struct acpi_memory_device *mem_device = NULL;
......@@ -391,8 +380,7 @@ acpi_memory_device_add(struct acpi_device *device)
return_VALUE(result);
}
static int
acpi_memory_device_remove (struct acpi_device *device, int type)
static int acpi_memory_device_remove(struct acpi_device *device, int type)
{
struct acpi_memory_device *mem_device = NULL;
......@@ -401,7 +389,7 @@ acpi_memory_device_remove (struct acpi_device *device, int type)
if (!device || !acpi_driver_data(device))
return_VALUE(-EINVAL);
mem_device = (struct acpi_memory_device *) acpi_driver_data(device);
mem_device = (struct acpi_memory_device *)acpi_driver_data(device);
kfree(mem_device);
return_VALUE(0);
......@@ -410,12 +398,11 @@ acpi_memory_device_remove (struct acpi_device *device, int type)
/*
* Helper function to check for memory device
*/
static acpi_status
is_memory_device(acpi_handle handle)
static acpi_status is_memory_device(acpi_handle handle)
{
char *hardware_id;
acpi_status status;
struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
struct acpi_device_info *info;
ACPI_FUNCTION_TRACE("is_memory_device");
......@@ -440,7 +427,7 @@ is_memory_device(acpi_handle handle)
}
static acpi_status
acpi_memory_register_notify_handler (acpi_handle handle,
acpi_memory_register_notify_handler(acpi_handle handle,
u32 level, void *ctxt, void **retv)
{
acpi_status status;
......@@ -463,7 +450,7 @@ acpi_memory_register_notify_handler (acpi_handle handle,
}
static acpi_status
acpi_memory_deregister_notify_handler (acpi_handle handle,
acpi_memory_deregister_notify_handler(acpi_handle handle,
u32 level, void *ctxt, void **retv)
{
acpi_status status;
......@@ -475,7 +462,8 @@ acpi_memory_deregister_notify_handler (acpi_handle handle,
return_ACPI_STATUS(AE_OK); /* continue */
status = acpi_remove_notify_handler(handle,
ACPI_SYSTEM_NOTIFY, acpi_memory_device_notify);
ACPI_SYSTEM_NOTIFY,
acpi_memory_device_notify);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error removing notify handler\n"));
......@@ -485,8 +473,7 @@ acpi_memory_deregister_notify_handler (acpi_handle handle,
return_ACPI_STATUS(status);
}
static int __init
acpi_memory_device_init (void)
static int __init acpi_memory_device_init(void)
{
int result;
acpi_status status;
......@@ -503,8 +490,8 @@ acpi_memory_device_init (void)
acpi_memory_register_notify_handler,
NULL, NULL);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "walk_namespace failed\n"));
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "walk_namespace failed\n"));
acpi_bus_unregister_driver(&acpi_memory_device_driver);
return_VALUE(-ENODEV);
}
......@@ -512,8 +499,7 @@ acpi_memory_device_init (void)
return_VALUE(0);
}
static void __exit
acpi_memory_device_exit (void)
static void __exit acpi_memory_device_exit(void)
{
acpi_status status;
......@@ -528,8 +514,8 @@ acpi_memory_device_exit (void)
acpi_memory_deregister_notify_handler,
NULL, NULL);
if (ACPI_FAILURE (status))
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "walk_namespace failed\n"));
if (ACPI_FAILURE(status))
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "walk_namespace failed\n"));
acpi_bus_unregister_driver(&acpi_memory_device_driver);
......@@ -538,5 +524,3 @@ acpi_memory_device_exit (void)
module_init(acpi_memory_device_init);
module_exit(acpi_memory_device_exit);
This diff is collapsed.
This diff is collapsed.
......@@ -26,7 +26,6 @@
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
......@@ -34,16 +33,14 @@
#include <acpi/acpi_bus.h>
#include <linux/dmi.h>
enum acpi_blacklist_predicates
{
enum acpi_blacklist_predicates {
all_versions,
less_than_or_equal,
equal,
greater_than_or_equal,
};
struct acpi_blacklist_item
{
struct acpi_blacklist_item {
char oem_id[7];
char oem_table_id[9];
u32 oem_revision;
......@@ -57,26 +54,28 @@ struct acpi_blacklist_item
* POLICY: If *anything* doesn't work, put it on the blacklist.
* If they are critical errors, mark it critical, and abort driver load.
*/
static struct acpi_blacklist_item acpi_blacklist[] __initdata =
{
static struct acpi_blacklist_item acpi_blacklist[] __initdata = {
/* Compaq Presario 1700 */
{"PTLTD ", " DSDT ", 0x06040000, ACPI_DSDT, less_than_or_equal, "Multiple problems", 1},
{"PTLTD ", " DSDT ", 0x06040000, ACPI_DSDT, less_than_or_equal,
"Multiple problems", 1},
/* Sony FX120, FX140, FX150? */
{"SONY ", "U0 ", 0x20010313, ACPI_DSDT, less_than_or_equal, "ACPI driver problem", 1},
{"SONY ", "U0 ", 0x20010313, ACPI_DSDT, less_than_or_equal,
"ACPI driver problem", 1},
/* Compaq Presario 800, Insyde BIOS */
{"INT440", "SYSFexxx", 0x00001001, ACPI_DSDT, less_than_or_equal, "Does not use _REG to protect EC OpRegions", 1},
{"INT440", "SYSFexxx", 0x00001001, ACPI_DSDT, less_than_or_equal,
"Does not use _REG to protect EC OpRegions", 1},
/* IBM 600E - _ADR should return 7, but it returns 1 */
{"IBM ", "TP600E ", 0x00000105, ACPI_DSDT, less_than_or_equal, "Incorrect _ADR", 1},
{"ASUS\0\0", "P2B-S ", 0, ACPI_DSDT, all_versions, "Bogus PCI routing", 1},
{"IBM ", "TP600E ", 0x00000105, ACPI_DSDT, less_than_or_equal,
"Incorrect _ADR", 1},
{"ASUS\0\0", "P2B-S ", 0, ACPI_DSDT, all_versions,
"Bogus PCI routing", 1},
{""}
};
#if CONFIG_ACPI_BLACKLIST_YEAR
static int __init
blacklist_by_year(void)
static int __init blacklist_by_year(void)
{
int year;
char *s = dmi_get_system_info(DMI_BIOS_DATE);
......@@ -92,7 +91,7 @@ blacklist_by_year(void)
s += 1;
year = simple_strtoul(s,NULL,0);
year = simple_strtoul(s, NULL, 0);
if (year < 100) { /* 2-digit year */
year += 1900;
......@@ -109,19 +108,21 @@ blacklist_by_year(void)
return 0;
}
#else
static inline int blacklist_by_year(void) { return 0; }
static inline int blacklist_by_year(void)
{
return 0;
}
#endif
int __init
acpi_blacklisted(void)
int __init acpi_blacklisted(void)
{
int i = 0;
int blacklisted = 0;
struct acpi_table_header *table_header;
while (acpi_blacklist[i].oem_id[0] != '\0')
{
if (acpi_get_table_header_early(acpi_blacklist[i].table, &table_header)) {
while (acpi_blacklist[i].oem_id[0] != '\0') {
if (acpi_get_table_header_early
(acpi_blacklist[i].table, &table_header)) {
i++;
continue;
}
......@@ -131,33 +132,43 @@ acpi_blacklisted(void)
continue;
}
if (strncmp(acpi_blacklist[i].oem_table_id, table_header->oem_table_id, 8)) {
if (strncmp
(acpi_blacklist[i].oem_table_id, table_header->oem_table_id,
8)) {
i++;
continue;
}
if ((acpi_blacklist[i].oem_revision_predicate == all_versions)
|| (acpi_blacklist[i].oem_revision_predicate == less_than_or_equal
&& table_header->oem_revision <= acpi_blacklist[i].oem_revision)
|| (acpi_blacklist[i].oem_revision_predicate == greater_than_or_equal
&& table_header->oem_revision >= acpi_blacklist[i].oem_revision)
|| (acpi_blacklist[i].oem_revision_predicate ==
less_than_or_equal
&& table_header->oem_revision <=
acpi_blacklist[i].oem_revision)
|| (acpi_blacklist[i].oem_revision_predicate ==
greater_than_or_equal
&& table_header->oem_revision >=
acpi_blacklist[i].oem_revision)
|| (acpi_blacklist[i].oem_revision_predicate == equal
&& table_header->oem_revision == acpi_blacklist[i].oem_revision)) {
&& table_header->oem_revision ==
acpi_blacklist[i].oem_revision)) {
printk(KERN_ERR PREFIX "Vendor \"%6.6s\" System \"%8.8s\" "
printk(KERN_ERR PREFIX
"Vendor \"%6.6s\" System \"%8.8s\" "
"Revision 0x%x has a known ACPI BIOS problem.\n",
acpi_blacklist[i].oem_id,
acpi_blacklist[i].oem_table_id,
acpi_blacklist[i].oem_revision);
printk(KERN_ERR PREFIX "Reason: %s. This is a %s error\n",
printk(KERN_ERR PREFIX
"Reason: %s. This is a %s error\n",
acpi_blacklist[i].reason,
(acpi_blacklist[i].is_critical_error ? "non-recoverable" : "recoverable"));
(acpi_blacklist[i].
is_critical_error ? "non-recoverable" :
"recoverable"));
blacklisted = acpi_blacklist[i].is_critical_error;
break;
}
else {
} else {
i++;
}
}
......@@ -166,4 +177,3 @@ acpi_blacklisted(void)
return blacklisted;
}
This diff is collapsed.
......@@ -32,7 +32,6 @@
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#define ACPI_BUTTON_COMPONENT 0x00080000
#define ACPI_BUTTON_DRIVER_NAME "ACPI Button Driver"
#define ACPI_BUTTON_CLASS "button"
......@@ -61,15 +60,14 @@
#define ACPI_BUTTON_TYPE_LID 0x05
#define _COMPONENT ACPI_BUTTON_COMPONENT
ACPI_MODULE_NAME ("acpi_button")
ACPI_MODULE_NAME("acpi_button")
MODULE_AUTHOR("Paul Diefenbaugh");
MODULE_AUTHOR("Paul Diefenbaugh");
MODULE_DESCRIPTION(ACPI_BUTTON_DRIVER_NAME);
MODULE_LICENSE("GPL");
static int acpi_button_add (struct acpi_device *device);
static int acpi_button_remove (struct acpi_device *device, int type);
static int acpi_button_add(struct acpi_device *device);
static int acpi_button_remove(struct acpi_device *device, int type);
static int acpi_button_info_open_fs(struct inode *inode, struct file *file);
static int acpi_button_state_open_fs(struct inode *inode, struct file *file);
......@@ -103,6 +101,7 @@ static struct file_operations acpi_button_state_fops = {
.llseek = seq_lseek,
.release = single_release,
};
/* --------------------------------------------------------------------------
FS Interface (/proc)
-------------------------------------------------------------------------- */
......@@ -111,7 +110,7 @@ static struct proc_dir_entry *acpi_button_dir;
static int acpi_button_info_seq_show(struct seq_file *seq, void *offset)
{
struct acpi_button *button = (struct acpi_button *) seq->private;
struct acpi_button *button = (struct acpi_button *)seq->private;
ACPI_FUNCTION_TRACE("acpi_button_info_seq_show");
......@@ -131,7 +130,7 @@ static int acpi_button_info_open_fs(struct inode *inode, struct file *file)
static int acpi_button_state_seq_show(struct seq_file *seq, void *offset)
{
struct acpi_button *button = (struct acpi_button *) seq->private;
struct acpi_button *button = (struct acpi_button *)seq->private;
acpi_status status;
unsigned long state;
......@@ -140,12 +139,12 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset)
if (!button || !button->device)
return_VALUE(0);
status = acpi_evaluate_integer(button->handle,"_LID",NULL,&state);
status = acpi_evaluate_integer(button->handle, "_LID", NULL, &state);
if (ACPI_FAILURE(status)) {
seq_printf(seq, "state: unsupported\n");
}
else{
seq_printf(seq, "state: %s\n", (state ? "open" : "closed"));
} else {
seq_printf(seq, "state: %s\n",
(state ? "open" : "closed"));
}
return_VALUE(0);
......@@ -160,9 +159,7 @@ static struct proc_dir_entry *acpi_power_dir;
static struct proc_dir_entry *acpi_sleep_dir;
static struct proc_dir_entry *acpi_lid_dir;
static int
acpi_button_add_fs (
struct acpi_device *device)
static int acpi_button_add_fs(struct acpi_device *device)
{
struct proc_dir_entry *entry = NULL;
struct acpi_button *button = NULL;
......@@ -237,10 +234,7 @@ acpi_button_add_fs (
return_VALUE(0);
}
static int
acpi_button_remove_fs (
struct acpi_device *device)
static int acpi_button_remove_fs(struct acpi_device *device)
{
struct acpi_button *button = NULL;
......@@ -262,18 +256,13 @@ acpi_button_remove_fs (
return_VALUE(0);
}
/* --------------------------------------------------------------------------
Driver Interface
-------------------------------------------------------------------------- */
static void
acpi_button_notify (
acpi_handle handle,
u32 event,
void *data)
static void acpi_button_notify(acpi_handle handle, u32 event, void *data)
{
struct acpi_button *button = (struct acpi_button *) data;
struct acpi_button *button = (struct acpi_button *)data;
ACPI_FUNCTION_TRACE("acpi_button_notify");
......@@ -282,7 +271,8 @@ acpi_button_notify (
switch (event) {
case ACPI_BUTTON_NOTIFY_STATUS:
acpi_bus_generate_event(button->device, event, ++button->pushed);
acpi_bus_generate_event(button->device, event,
++button->pushed);
break;
default:
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
......@@ -293,12 +283,9 @@ acpi_button_notify (
return_VOID;
}
static acpi_status
acpi_button_notify_fixed (
void *data)
static acpi_status acpi_button_notify_fixed(void *data)
{
struct acpi_button *button = (struct acpi_button *) data;
struct acpi_button *button = (struct acpi_button *)data;
ACPI_FUNCTION_TRACE("acpi_button_notify_fixed");
......@@ -310,10 +297,7 @@ acpi_button_notify_fixed (
return_ACPI_STATUS(AE_OK);
}
static int
acpi_button_add (
struct acpi_device *device)
static int acpi_button_add(struct acpi_device *device)
{
int result = 0;
acpi_status status = AE_OK;
......@@ -339,40 +323,32 @@ acpi_button_add (
*/
if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_POWER)) {
button->type = ACPI_BUTTON_TYPE_POWER;
strcpy(acpi_device_name(device),
ACPI_BUTTON_DEVICE_NAME_POWER);
strcpy(acpi_device_name(device), ACPI_BUTTON_DEVICE_NAME_POWER);
sprintf(acpi_device_class(device), "%s/%s",
ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_POWER);
}
else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_POWERF)) {
} else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_POWERF)) {
button->type = ACPI_BUTTON_TYPE_POWERF;
strcpy(acpi_device_name(device),
ACPI_BUTTON_DEVICE_NAME_POWERF);
sprintf(acpi_device_class(device), "%s/%s",
ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_POWER);
}
else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_SLEEP)) {
} else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_SLEEP)) {
button->type = ACPI_BUTTON_TYPE_SLEEP;
strcpy(acpi_device_name(device),
ACPI_BUTTON_DEVICE_NAME_SLEEP);
strcpy(acpi_device_name(device), ACPI_BUTTON_DEVICE_NAME_SLEEP);
sprintf(acpi_device_class(device), "%s/%s",
ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_SLEEP);
}
else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_SLEEPF)) {
} else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_SLEEPF)) {
button->type = ACPI_BUTTON_TYPE_SLEEPF;
strcpy(acpi_device_name(device),
ACPI_BUTTON_DEVICE_NAME_SLEEPF);
sprintf(acpi_device_class(device), "%s/%s",
ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_SLEEP);
}
else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_LID)) {
} else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_LID)) {
button->type = ACPI_BUTTON_TYPE_LID;
strcpy(acpi_device_name(device),
ACPI_BUTTON_DEVICE_NAME_LID);
strcpy(acpi_device_name(device), ACPI_BUTTON_DEVICE_NAME_LID);
sprintf(acpi_device_class(device), "%s/%s",
ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_LID);
}
else {
} else {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unsupported hid [%s]\n",
acpi_device_hid(device)));
result = -ENODEV;
......@@ -385,20 +361,19 @@ acpi_button_add (
switch (button->type) {
case ACPI_BUTTON_TYPE_POWERF:
status = acpi_install_fixed_event_handler (
ACPI_EVENT_POWER_BUTTON,
status =
acpi_install_fixed_event_handler(ACPI_EVENT_POWER_BUTTON,
acpi_button_notify_fixed,
button);
break;
case ACPI_BUTTON_TYPE_SLEEPF:
status = acpi_install_fixed_event_handler (
ACPI_EVENT_SLEEP_BUTTON,
status =
acpi_install_fixed_event_handler(ACPI_EVENT_SLEEP_BUTTON,
acpi_button_notify_fixed,
button);
break;
default:
status = acpi_install_notify_handler (
button->handle,
status = acpi_install_notify_handler(button->handle,
ACPI_DEVICE_NOTIFY,
acpi_button_notify,
button);
......@@ -415,7 +390,8 @@ acpi_button_add (
if (device->wakeup.flags.valid) {
/* Button's GPE is run-wake GPE */
acpi_set_gpe_type(device->wakeup.gpe_device,
device->wakeup.gpe_number, ACPI_GPE_TYPE_WAKE_RUN);
device->wakeup.gpe_number,
ACPI_GPE_TYPE_WAKE_RUN);
acpi_enable_gpe(device->wakeup.gpe_device,
device->wakeup.gpe_number, ACPI_NOT_ISR);
device->wakeup.state.enabled = 1;
......@@ -424,7 +400,7 @@ acpi_button_add (
printk(KERN_INFO PREFIX "%s [%s]\n",
acpi_device_name(device), acpi_device_bid(device));
end:
end:
if (result) {
acpi_button_remove_fs(device);
kfree(button);
......@@ -433,9 +409,7 @@ acpi_button_add (
return_VALUE(result);
}
static int
acpi_button_remove (struct acpi_device *device, int type)
static int acpi_button_remove(struct acpi_device *device, int type)
{
acpi_status status = 0;
struct acpi_button *button = NULL;
......@@ -450,16 +424,19 @@ acpi_button_remove (struct acpi_device *device, int type)
/* Unregister for device notifications. */
switch (button->type) {
case ACPI_BUTTON_TYPE_POWERF:
status = acpi_remove_fixed_event_handler(
ACPI_EVENT_POWER_BUTTON, acpi_button_notify_fixed);
status =
acpi_remove_fixed_event_handler(ACPI_EVENT_POWER_BUTTON,
acpi_button_notify_fixed);
break;
case ACPI_BUTTON_TYPE_SLEEPF:
status = acpi_remove_fixed_event_handler(
ACPI_EVENT_SLEEP_BUTTON, acpi_button_notify_fixed);
status =
acpi_remove_fixed_event_handler(ACPI_EVENT_SLEEP_BUTTON,
acpi_button_notify_fixed);
break;
default:
status = acpi_remove_notify_handler(button->handle,
ACPI_DEVICE_NOTIFY, acpi_button_notify);
ACPI_DEVICE_NOTIFY,
acpi_button_notify);
break;
}
......@@ -474,9 +451,7 @@ acpi_button_remove (struct acpi_device *device, int type)
return_VALUE(0);
}
static int __init
acpi_button_init (void)
static int __init acpi_button_init(void)
{
int result = 0;
......@@ -495,9 +470,7 @@ acpi_button_init (void)
return_VALUE(0);
}
static void __exit
acpi_button_exit (void)
static void __exit acpi_button_exit(void)
{
ACPI_FUNCTION_TRACE("acpi_button_exit");
......@@ -514,6 +487,5 @@ acpi_button_exit (void)
return_VOID;
}
module_init(acpi_button_init);
module_exit(acpi_button_exit);
......@@ -44,9 +44,9 @@
#define ACPI_CONTAINER_COMPONENT 0x01000000
#define _COMPONENT ACPI_CONTAINER_COMPONENT
ACPI_MODULE_NAME ("acpi_container")
ACPI_MODULE_NAME("acpi_container")
MODULE_AUTHOR("Anil S Keshavamurthy");
MODULE_AUTHOR("Anil S Keshavamurthy");
MODULE_DESCRIPTION(ACPI_CONTAINER_DRIVER_NAME);
MODULE_LICENSE("GPL");
......@@ -65,11 +65,9 @@ static struct acpi_driver acpi_container_driver = {
},
};
/*******************************************************************/
static int
is_device_present(acpi_handle handle)
static int is_device_present(acpi_handle handle)
{
acpi_handle temp;
acpi_status status;
......@@ -89,8 +87,7 @@ is_device_present(acpi_handle handle)
}
/*******************************************************************/
static int
acpi_container_add(struct acpi_device *device)
static int acpi_container_add(struct acpi_device *device)
{
struct acpi_container *container;
......@@ -102,7 +99,7 @@ acpi_container_add(struct acpi_device *device)
}
container = kmalloc(sizeof(struct acpi_container), GFP_KERNEL);
if(!container)
if (!container)
return_VALUE(-ENOMEM);
memset(container, 0, sizeof(struct acpi_container));
......@@ -111,19 +108,17 @@ acpi_container_add(struct acpi_device *device)
strcpy(acpi_device_class(device), ACPI_CONTAINER_CLASS);
acpi_driver_data(device) = container;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device <%s> bid <%s>\n", \
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device <%s> bid <%s>\n",
acpi_device_name(device), acpi_device_bid(device)));
return_VALUE(0);
}
static int
acpi_container_remove(struct acpi_device *device, int type)
static int acpi_container_remove(struct acpi_device *device, int type)
{
acpi_status status = AE_OK;
struct acpi_container *pc = NULL;
pc = (struct acpi_container*) acpi_driver_data(device);
pc = (struct acpi_container *)acpi_driver_data(device);
if (pc)
kfree(pc);
......@@ -131,9 +126,7 @@ acpi_container_remove(struct acpi_device *device, int type)
return status;
}
static int
container_device_add(struct acpi_device **device, acpi_handle handle)
static int container_device_add(struct acpi_device **device, acpi_handle handle)
{
acpi_handle phandle;
struct acpi_device *pdev;
......@@ -158,8 +151,7 @@ container_device_add(struct acpi_device **device, acpi_handle handle)
return_VALUE(result);
}
static void
container_notify_cb(acpi_handle handle, u32 type, void *context)
static void container_notify_cb(acpi_handle handle, u32 type, void *context)
{
struct acpi_device *device = NULL;
int result;
......@@ -175,8 +167,8 @@ container_notify_cb(acpi_handle handle, u32 type, void *context)
/* Fall through */
case ACPI_NOTIFY_DEVICE_CHECK:
printk("Container driver received %s event\n",
(type == ACPI_NOTIFY_BUS_CHECK)?
"ACPI_NOTIFY_BUS_CHECK":"ACPI_NOTIFY_DEVICE_CHECK");
(type == ACPI_NOTIFY_BUS_CHECK) ?
"ACPI_NOTIFY_BUS_CHECK" : "ACPI_NOTIFY_DEVICE_CHECK");
status = acpi_bus_get_device(handle, &device);
if (present) {
if (ACPI_FAILURE(status) || !device) {
......@@ -207,12 +199,10 @@ container_notify_cb(acpi_handle handle, u32 type, void *context)
static acpi_status
container_walk_namespace_cb(acpi_handle handle,
u32 lvl,
void *context,
void **rv)
u32 lvl, void *context, void **rv)
{
char *hid = NULL;
struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
struct acpi_device_info *info;
acpi_status status;
int *action = context;
......@@ -237,12 +227,11 @@ container_walk_namespace_cb(acpi_handle handle,
goto end;
}
switch(*action) {
switch (*action) {
case INSTALL_NOTIFY_HANDLER:
acpi_install_notify_handler(handle,
ACPI_SYSTEM_NOTIFY,
container_notify_cb,
NULL);
container_notify_cb, NULL);
break;
case UNINSTALL_NOTIFY_HANDLER:
acpi_remove_notify_handler(handle,
......@@ -253,36 +242,32 @@ container_walk_namespace_cb(acpi_handle handle,
break;
}
end:
end:
acpi_os_free(buffer.pointer);
return_ACPI_STATUS(AE_OK);
}
static int __init
acpi_container_init(void)
static int __init acpi_container_init(void)
{
int result = 0;
int action = INSTALL_NOTIFY_HANDLER;
result = acpi_bus_register_driver(&acpi_container_driver);
if (result < 0) {
return(result);
return (result);
}
/* register notify handler to every container device */
acpi_walk_namespace(ACPI_TYPE_DEVICE,
ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX,
container_walk_namespace_cb,
&action, NULL);
container_walk_namespace_cb, &action, NULL);
return(0);
return (0);
}
static void __exit
acpi_container_exit(void)
static void __exit acpi_container_exit(void)
{
int action = UNINSTALL_NOTIFY_HANDLER;
......@@ -291,8 +276,7 @@ acpi_container_exit(void)
acpi_walk_namespace(ACPI_TYPE_DEVICE,
ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX,
container_walk_namespace_cb,
&action, NULL);
container_walk_namespace_cb, &action, NULL);
acpi_bus_unregister_driver(&acpi_container_driver);
......
......@@ -12,17 +12,14 @@
#include <acpi/acglobal.h>
#define _COMPONENT ACPI_SYSTEM_COMPONENT
ACPI_MODULE_NAME ("debug")
ACPI_MODULE_NAME("debug")
#define ACPI_SYSTEM_FILE_DEBUG_LAYER "debug_layer"
#define ACPI_SYSTEM_FILE_DEBUG_LEVEL "debug_level"
#ifdef MODULE_PARAM_PREFIX
#undef MODULE_PARAM_PREFIX
#endif
#define MODULE_PARAM_PREFIX
module_param(acpi_dbg_layer, uint, 0400);
module_param(acpi_dbg_layer, uint, 0400);
module_param(acpi_dbg_level, uint, 0400);
struct acpi_dlayer {
......@@ -35,8 +32,7 @@ struct acpi_dlevel {
};
#define ACPI_DEBUG_INIT(v) { .name = #v, .value = v }
static const struct acpi_dlayer acpi_debug_layers[] =
{
static const struct acpi_dlayer acpi_debug_layers[] = {
ACPI_DEBUG_INIT(ACPI_UTILITIES),
ACPI_DEBUG_INIT(ACPI_HARDWARE),
ACPI_DEBUG_INIT(ACPI_EVENTS),
......@@ -53,8 +49,7 @@ static const struct acpi_dlayer acpi_debug_layers[] =
ACPI_DEBUG_INIT(ACPI_TOOLS),
};
static const struct acpi_dlevel acpi_debug_levels[] =
{
static const struct acpi_dlevel acpi_debug_levels[] = {
ACPI_DEBUG_INIT(ACPI_LV_ERROR),
ACPI_DEBUG_INIT(ACPI_LV_WARN),
ACPI_DEBUG_INIT(ACPI_LV_INIT),
......@@ -92,13 +87,8 @@ static const struct acpi_dlevel acpi_debug_levels[] =
};
static int
acpi_system_read_debug (
char *page,
char **start,
off_t off,
int count,
int *eof,
void *data)
acpi_system_read_debug(char *page,
char **start, off_t off, int count, int *eof, void *data)
{
char *p = page;
int size = 0;
......@@ -109,20 +99,21 @@ acpi_system_read_debug (
p += sprintf(p, "%-25s\tHex SET\n", "Description");
switch ((unsigned long) data) {
switch ((unsigned long)data) {
case 0:
for (i = 0; i < ARRAY_SIZE(acpi_debug_layers); i++) {
p += sprintf(p, "%-25s\t0x%08lX [%c]\n",
acpi_debug_layers[i].name,
acpi_debug_layers[i].value,
(acpi_dbg_layer & acpi_debug_layers[i].value) ?
'*' : ' ');
(acpi_dbg_layer & acpi_debug_layers[i].
value) ? '*' : ' ');
}
p += sprintf(p, "%-25s\t0x%08X [%c]\n", "ACPI_ALL_DRIVERS",
ACPI_ALL_DRIVERS,
(acpi_dbg_layer & ACPI_ALL_DRIVERS) == ACPI_ALL_DRIVERS?
'*' : (acpi_dbg_layer & ACPI_ALL_DRIVERS) == 0 ?
' ' : '-');
(acpi_dbg_layer & ACPI_ALL_DRIVERS) ==
ACPI_ALL_DRIVERS ? '*' : (acpi_dbg_layer &
ACPI_ALL_DRIVERS) ==
0 ? ' ' : '-');
p += sprintf(p,
"--\ndebug_layer = 0x%08X (* = enabled, - = partial)\n",
acpi_dbg_layer);
......@@ -132,8 +123,8 @@ acpi_system_read_debug (
p += sprintf(p, "%-25s\t0x%08lX [%c]\n",
acpi_debug_levels[i].name,
acpi_debug_levels[i].value,
(acpi_dbg_level & acpi_debug_levels[i].value) ?
'*' : ' ');
(acpi_dbg_level & acpi_debug_levels[i].
value) ? '*' : ' ');
}
p += sprintf(p, "--\ndebug_level = 0x%08X (* = enabled)\n",
acpi_dbg_level);
......@@ -143,26 +134,26 @@ acpi_system_read_debug (
break;
}
end:
end:
size = (p - page);
if (size <= off+count) *eof = 1;
if (size <= off + count)
*eof = 1;
*start = page + off;
size -= off;
if (size>count) size = count;
if (size<0) size = 0;
if (size > count)
size = count;
if (size < 0)
size = 0;
return size;
}
static int
acpi_system_write_debug (
struct file *file,
const char __user *buffer,
unsigned long count,
void *data)
acpi_system_write_debug(struct file *file,
const char __user * buffer,
unsigned long count, void *data)
{
char debug_string[12] = {'\0'};
char debug_string[12] = { '\0' };
ACPI_FUNCTION_TRACE("acpi_system_write_debug");
......@@ -174,7 +165,7 @@ acpi_system_write_debug (
debug_string[count] = '\0';
switch ((unsigned long) data) {
switch ((unsigned long)data) {
case 0:
acpi_dbg_layer = simple_strtoul(debug_string, NULL, 0);
break;
......@@ -192,7 +183,7 @@ static int __init acpi_debug_init(void)
{
struct proc_dir_entry *entry;
int error = 0;
char * name;
char *name;
ACPI_FUNCTION_TRACE("acpi_debug_init");
......@@ -201,8 +192,10 @@ static int __init acpi_debug_init(void)
/* 'debug_layer' [R/W] */
name = ACPI_SYSTEM_FILE_DEBUG_LAYER;
entry = create_proc_read_entry(name, S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir,
acpi_system_read_debug,(void *)0);
entry =
create_proc_read_entry(name, S_IFREG | S_IRUGO | S_IWUSR,
acpi_root_dir, acpi_system_read_debug,
(void *)0);
if (entry)
entry->write_proc = acpi_system_write_debug;
else
......@@ -210,8 +203,10 @@ static int __init acpi_debug_init(void)
/* 'debug_level' [R/W] */
name = ACPI_SYSTEM_FILE_DEBUG_LEVEL;
entry = create_proc_read_entry(name, S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir,
acpi_system_read_debug, (void *)1);
entry =
create_proc_read_entry(name, S_IFREG | S_IRUGO | S_IWUSR,
acpi_root_dir, acpi_system_read_debug,
(void *)1);
if (entry)
entry->write_proc = acpi_system_write_debug;
else
......
This diff is collapsed.
......@@ -41,23 +41,17 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <acpi/acpi.h>
#include <acpi/acdispat.h>
#include <acpi/acnamesp.h>
#define _COMPONENT ACPI_DISPATCHER
ACPI_MODULE_NAME ("dsinit")
ACPI_MODULE_NAME("dsinit")
/* Local prototypes */
static acpi_status
acpi_ds_init_one_object (
acpi_handle obj_handle,
u32 level,
void *context,
void **return_value);
acpi_ds_init_one_object(acpi_handle obj_handle,
u32 level, void *context, void **return_value);
/*******************************************************************************
*
......@@ -80,20 +74,17 @@ acpi_ds_init_one_object (
******************************************************************************/
static acpi_status
acpi_ds_init_one_object (
acpi_handle obj_handle,
u32 level,
void *context,
void **return_value)
acpi_ds_init_one_object(acpi_handle obj_handle,
u32 level, void *context, void **return_value)
{
struct acpi_init_walk_info *info = (struct acpi_init_walk_info *) context;
struct acpi_namespace_node *node = (struct acpi_namespace_node *) obj_handle;
struct acpi_init_walk_info *info =
(struct acpi_init_walk_info *)context;
struct acpi_namespace_node *node =
(struct acpi_namespace_node *)obj_handle;
acpi_object_type type;
acpi_status status;
ACPI_FUNCTION_NAME ("ds_init_one_object");
ACPI_FUNCTION_NAME("ds_init_one_object");
/*
* We are only interested in NS nodes owned by the table that
......@@ -107,23 +98,23 @@ acpi_ds_init_one_object (
/* And even then, we are only interested in a few object types */
type = acpi_ns_get_type (obj_handle);
type = acpi_ns_get_type(obj_handle);
switch (type) {
case ACPI_TYPE_REGION:
status = acpi_ds_initialize_region (obj_handle);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
status = acpi_ds_initialize_region(obj_handle);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Region %p [%4.4s] - Init failure, %s\n",
obj_handle, acpi_ut_get_node_name (obj_handle),
acpi_format_exception (status)));
obj_handle,
acpi_ut_get_node_name(obj_handle),
acpi_format_exception(status)));
}
info->op_region_count++;
break;
case ACPI_TYPE_METHOD:
/*
......@@ -131,7 +122,7 @@ acpi_ds_init_one_object (
* the entire pathname
*/
if (!(acpi_dbg_level & ACPI_LV_INIT_NAMES)) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "."));
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, "."));
}
/*
......@@ -148,12 +139,13 @@ acpi_ds_init_one_object (
* Always parse methods to detect errors, we will delete
* the parse tree below
*/
status = acpi_ds_parse_method (obj_handle);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
status = acpi_ds_parse_method(obj_handle);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"\n+Method %p [%4.4s] - parse failure, %s\n",
obj_handle, acpi_ut_get_node_name (obj_handle),
acpi_format_exception (status)));
obj_handle,
acpi_ut_get_node_name(obj_handle),
acpi_format_exception(status)));
/* This parse failed, but we will continue parsing more methods */
}
......@@ -161,13 +153,11 @@ acpi_ds_init_one_object (
info->method_count++;
break;
case ACPI_TYPE_DEVICE:
info->device_count++;
break;
default:
break;
}
......@@ -179,7 +169,6 @@ acpi_ds_init_one_object (
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: acpi_ds_initialize_objects
......@@ -195,20 +184,17 @@ acpi_ds_init_one_object (
******************************************************************************/
acpi_status
acpi_ds_initialize_objects (
struct acpi_table_desc *table_desc,
struct acpi_namespace_node *start_node)
acpi_ds_initialize_objects(struct acpi_table_desc * table_desc,
struct acpi_namespace_node * start_node)
{
acpi_status status;
struct acpi_init_walk_info info;
ACPI_FUNCTION_TRACE("ds_initialize_objects");
ACPI_FUNCTION_TRACE ("ds_initialize_objects");
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"**** Starting initialization of namespace objects ****\n"));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "Parsing all Control Methods:"));
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, "Parsing all Control Methods:"));
info.method_count = 0;
info.op_region_count = 0;
......@@ -218,22 +204,23 @@ acpi_ds_initialize_objects (
/* Walk entire namespace from the supplied root */
status = acpi_walk_namespace (ACPI_TYPE_ANY, start_node, ACPI_UINT32_MAX,
status = acpi_walk_namespace(ACPI_TYPE_ANY, start_node, ACPI_UINT32_MAX,
acpi_ds_init_one_object, &info, NULL);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "walk_namespace failed, %s\n",
acpi_format_exception (status)));
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "walk_namespace failed, %s\n",
acpi_format_exception(status)));
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
"\nTable [%4.4s](id %4.4X) - %hd Objects with %hd Devices %hd Methods %hd Regions\n",
table_desc->pointer->signature, table_desc->owner_id, info.object_count,
info.device_count, info.method_count, info.op_region_count));
table_desc->pointer->signature,
table_desc->owner_id, info.object_count,
info.device_count, info.method_count,
info.op_region_count));
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"%hd Methods, %hd Regions\n", info.method_count, info.op_region_count));
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"%hd Methods, %hd Regions\n", info.method_count,
info.op_region_count));
return_ACPI_STATUS (AE_OK);
return_ACPI_STATUS(AE_OK);
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -29,7 +29,8 @@ int register_acpi_bus_type(struct acpi_bus_type *type)
down_write(&bus_type_sem);
list_add_tail(&type->list, &bus_type_list);
up_write(&bus_type_sem);
printk(KERN_INFO PREFIX "bus type %s registered\n", type->bus->name);
printk(KERN_INFO PREFIX "bus type %s registered\n",
type->bus->name);
return 0;
}
return -ENODEV;
......@@ -45,7 +46,8 @@ int unregister_acpi_bus_type(struct acpi_bus_type *type)
down_write(&bus_type_sem);
list_del_init(&type->list);
up_write(&bus_type_sem);
printk(KERN_INFO PREFIX "ACPI bus type %s unregistered\n", type->bus->name);
printk(KERN_INFO PREFIX "ACPI bus type %s unregistered\n",
type->bus->name);
return 0;
}
return -ENODEV;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment