Loading drivers/acpi/ac.c +6 −8 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ static struct acpi_driver acpi_ac_driver = { }; struct acpi_ac { acpi_handle handle; struct acpi_device * device; unsigned long state; }; Loading @@ -88,7 +88,7 @@ static int acpi_ac_get_state(struct acpi_ac *ac) if (!ac) return -EINVAL; status = acpi_evaluate_integer(ac->handle, "_PSR", NULL, &ac->state); status = acpi_evaluate_integer(ac->device->handle, "_PSR", NULL, &ac->state); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "Error reading AC Adapter state")); ac->state = ACPI_AC_STATUS_UNKNOWN; Loading Loading @@ -191,9 +191,7 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data) if (!ac) return; if (acpi_bus_get_device(ac->handle, &device)) return; device = ac->device; switch (event) { case ACPI_AC_NOTIFY_STATUS: acpi_ac_get_state(ac); Loading Loading @@ -223,7 +221,7 @@ static int acpi_ac_add(struct acpi_device *device) return -ENOMEM; memset(ac, 0, sizeof(struct acpi_ac)); ac->handle = device->handle; ac->device = device; strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_AC_CLASS); acpi_driver_data(device) = ac; Loading @@ -236,7 +234,7 @@ static int acpi_ac_add(struct acpi_device *device) if (result) goto end; status = acpi_install_notify_handler(ac->handle, status = acpi_install_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, acpi_ac_notify, ac); if (ACPI_FAILURE(status)) { Loading Loading @@ -268,7 +266,7 @@ static int acpi_ac_remove(struct acpi_device *device, int type) ac = (struct acpi_ac *)acpi_driver_data(device); status = acpi_remove_notify_handler(ac->handle, status = acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, acpi_ac_notify); acpi_ac_remove_fs(device); Loading drivers/acpi/acpi_memhotplug.c +7 −7 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ struct acpi_memory_info { }; struct acpi_memory_device { acpi_handle handle; struct acpi_device * device; unsigned int state; /* State of the memory device */ struct list_head res_list; }; Loading Loading @@ -129,7 +129,7 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device) struct acpi_memory_info *info, *n; status = acpi_walk_resources(mem_device->handle, METHOD_NAME__CRS, status = acpi_walk_resources(mem_device->device->handle, METHOD_NAME__CRS, acpi_memory_get_resource, mem_device); if (ACPI_FAILURE(status)) { list_for_each_entry_safe(info, n, &mem_device->res_list, list) Loading Loading @@ -192,7 +192,7 @@ static int acpi_memory_check_device(struct acpi_memory_device *mem_device) /* Get device present/absent information from the _STA */ if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->handle, "_STA", if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->device->handle, "_STA", NULL, ¤t_status))) return -ENODEV; /* Loading Loading @@ -222,7 +222,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) return result; } node = acpi_get_node(mem_device->handle); node = acpi_get_node(mem_device->device->handle); /* * Tell the VM there is more memory here... * Note: Assume that this function returns zero on success Loading Loading @@ -269,7 +269,7 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device) arg_list.pointer = &arg; arg.type = ACPI_TYPE_INTEGER; arg.integer.value = 1; status = acpi_evaluate_object(mem_device->handle, status = acpi_evaluate_object(mem_device->device->handle, "_EJ0", &arg_list, NULL); /* Return on _EJ0 failure */ if (ACPI_FAILURE(status)) { Loading @@ -278,7 +278,7 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device) } /* Evalute _STA to check if the device is disabled */ status = acpi_evaluate_integer(mem_device->handle, "_STA", status = acpi_evaluate_integer(mem_device->device->handle, "_STA", NULL, ¤t_status); if (ACPI_FAILURE(status)) return -ENODEV; Loading Loading @@ -398,7 +398,7 @@ static int acpi_memory_device_add(struct acpi_device *device) memset(mem_device, 0, sizeof(struct acpi_memory_device)); INIT_LIST_HEAD(&mem_device->res_list); mem_device->handle = device->handle; mem_device->device = device; sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME); sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS); acpi_driver_data(device) = mem_device; Loading drivers/acpi/battery.c +10 −13 Original line number Diff line number Diff line Loading @@ -108,7 +108,7 @@ struct acpi_battery_trips { }; struct acpi_battery { acpi_handle handle; struct acpi_device * device; struct acpi_battery_flags flags; struct acpi_battery_trips trips; unsigned long alarm; Loading Loading @@ -138,7 +138,7 @@ acpi_battery_get_info(struct acpi_battery *battery, /* Evalute _BIF */ status = acpi_evaluate_object(battery->handle, "_BIF", NULL, &buffer); status = acpi_evaluate_object(battery->device->handle, "_BIF", NULL, &buffer); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BIF")); return -ENODEV; Loading Loading @@ -198,7 +198,7 @@ acpi_battery_get_status(struct acpi_battery *battery, /* Evalute _BST */ status = acpi_evaluate_object(battery->handle, "_BST", NULL, &buffer); status = acpi_evaluate_object(battery->device->handle, "_BST", NULL, &buffer); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST")); return -ENODEV; Loading Loading @@ -255,7 +255,7 @@ acpi_battery_set_alarm(struct acpi_battery *battery, unsigned long alarm) arg0.integer.value = alarm; status = acpi_evaluate_object(battery->handle, "_BTP", &arg_list, NULL); status = acpi_evaluate_object(battery->device->handle, "_BTP", &arg_list, NULL); if (ACPI_FAILURE(status)) return -ENODEV; Loading @@ -278,9 +278,7 @@ static int acpi_battery_check(struct acpi_battery *battery) if (!battery) return -EINVAL; result = acpi_bus_get_device(battery->handle, &device); if (result) return result; device = battery->device; result = acpi_bus_get_status(device); if (result) Loading @@ -305,7 +303,7 @@ static int acpi_battery_check(struct acpi_battery *battery) /* See if alarms are supported, and if so, set default */ status = acpi_get_handle(battery->handle, "_BTP", &handle); status = acpi_get_handle(battery->device->handle, "_BTP", &handle); if (ACPI_SUCCESS(status)) { battery->flags.alarm = 1; acpi_battery_set_alarm(battery, battery->trips.warning); Loading Loading @@ -662,8 +660,7 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data) if (!battery) return; if (acpi_bus_get_device(handle, &device)) return; device = battery->device; switch (event) { case ACPI_BATTERY_NOTIFY_STATUS: Loading Loading @@ -695,7 +692,7 @@ static int acpi_battery_add(struct acpi_device *device) return -ENOMEM; memset(battery, 0, sizeof(struct acpi_battery)); battery->handle = device->handle; battery->device = device; strcpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_BATTERY_CLASS); acpi_driver_data(device) = battery; Loading @@ -708,7 +705,7 @@ static int acpi_battery_add(struct acpi_device *device) if (result) goto end; status = acpi_install_notify_handler(battery->handle, status = acpi_install_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, acpi_battery_notify, battery); if (ACPI_FAILURE(status)) { Loading Loading @@ -740,7 +737,7 @@ static int acpi_battery_remove(struct acpi_device *device, int type) battery = (struct acpi_battery *)acpi_driver_data(device); status = acpi_remove_notify_handler(battery->handle, status = acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, acpi_battery_notify); Loading drivers/acpi/button.c +4 −6 Original line number Diff line number Diff line Loading @@ -82,7 +82,6 @@ static struct acpi_driver acpi_button_driver = { }; struct acpi_button { acpi_handle handle; struct acpi_device *device; /* Fixed button kludge */ u8 type; unsigned long pushed; Loading Loading @@ -137,7 +136,7 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset) if (!button || !button->device) return 0; status = acpi_evaluate_integer(button->handle, "_LID", NULL, &state); status = acpi_evaluate_integer(button->device->handle, "_LID", NULL, &state); if (ACPI_FAILURE(status)) { seq_printf(seq, "state: unsupported\n"); } else { Loading Loading @@ -282,7 +281,7 @@ static acpi_status acpi_button_notify_fixed(void *data) if (!button) return AE_BAD_PARAMETER; acpi_button_notify(button->handle, ACPI_BUTTON_NOTIFY_STATUS, button); acpi_button_notify(button->device->handle, ACPI_BUTTON_NOTIFY_STATUS, button); return AE_OK; } Loading @@ -303,7 +302,6 @@ static int acpi_button_add(struct acpi_device *device) memset(button, 0, sizeof(struct acpi_button)); button->device = device; button->handle = device->handle; acpi_driver_data(device) = button; /* Loading Loading @@ -362,7 +360,7 @@ static int acpi_button_add(struct acpi_device *device) button); break; default: status = acpi_install_notify_handler(button->handle, status = acpi_install_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, acpi_button_notify, button); Loading Loading @@ -420,7 +418,7 @@ static int acpi_button_remove(struct acpi_device *device, int type) acpi_button_notify_fixed); break; default: status = acpi_remove_notify_handler(button->handle, status = acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, acpi_button_notify); break; Loading drivers/acpi/fan.c +5 −5 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ static struct acpi_driver acpi_fan_driver = { }; struct acpi_fan { acpi_handle handle; struct acpi_device * device; }; /* -------------------------------------------------------------------------- Loading @@ -80,7 +80,7 @@ static int acpi_fan_read_state(struct seq_file *seq, void *offset) if (fan) { if (acpi_bus_get_power(fan->handle, &state)) if (acpi_bus_get_power(fan->device->handle, &state)) seq_printf(seq, "status: ERROR\n"); else seq_printf(seq, "status: %s\n", Loading Loading @@ -112,7 +112,7 @@ acpi_fan_write_state(struct file *file, const char __user * buffer, state_string[count] = '\0'; result = acpi_bus_set_power(fan->handle, result = acpi_bus_set_power(fan->device->handle, simple_strtoul(state_string, NULL, 0)); if (result) return result; Loading Loading @@ -191,12 +191,12 @@ static int acpi_fan_add(struct acpi_device *device) return -ENOMEM; memset(fan, 0, sizeof(struct acpi_fan)); fan->handle = device->handle; fan->device = device; strcpy(acpi_device_name(device), "Fan"); strcpy(acpi_device_class(device), ACPI_FAN_CLASS); acpi_driver_data(device) = fan; result = acpi_bus_get_power(fan->handle, &state); result = acpi_bus_get_power(device->handle, &state); if (result) { printk(KERN_ERR PREFIX "Reading power state\n"); goto end; Loading Loading
drivers/acpi/ac.c +6 −8 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ static struct acpi_driver acpi_ac_driver = { }; struct acpi_ac { acpi_handle handle; struct acpi_device * device; unsigned long state; }; Loading @@ -88,7 +88,7 @@ static int acpi_ac_get_state(struct acpi_ac *ac) if (!ac) return -EINVAL; status = acpi_evaluate_integer(ac->handle, "_PSR", NULL, &ac->state); status = acpi_evaluate_integer(ac->device->handle, "_PSR", NULL, &ac->state); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "Error reading AC Adapter state")); ac->state = ACPI_AC_STATUS_UNKNOWN; Loading Loading @@ -191,9 +191,7 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data) if (!ac) return; if (acpi_bus_get_device(ac->handle, &device)) return; device = ac->device; switch (event) { case ACPI_AC_NOTIFY_STATUS: acpi_ac_get_state(ac); Loading Loading @@ -223,7 +221,7 @@ static int acpi_ac_add(struct acpi_device *device) return -ENOMEM; memset(ac, 0, sizeof(struct acpi_ac)); ac->handle = device->handle; ac->device = device; strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_AC_CLASS); acpi_driver_data(device) = ac; Loading @@ -236,7 +234,7 @@ static int acpi_ac_add(struct acpi_device *device) if (result) goto end; status = acpi_install_notify_handler(ac->handle, status = acpi_install_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, acpi_ac_notify, ac); if (ACPI_FAILURE(status)) { Loading Loading @@ -268,7 +266,7 @@ static int acpi_ac_remove(struct acpi_device *device, int type) ac = (struct acpi_ac *)acpi_driver_data(device); status = acpi_remove_notify_handler(ac->handle, status = acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, acpi_ac_notify); acpi_ac_remove_fs(device); Loading
drivers/acpi/acpi_memhotplug.c +7 −7 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ struct acpi_memory_info { }; struct acpi_memory_device { acpi_handle handle; struct acpi_device * device; unsigned int state; /* State of the memory device */ struct list_head res_list; }; Loading Loading @@ -129,7 +129,7 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device) struct acpi_memory_info *info, *n; status = acpi_walk_resources(mem_device->handle, METHOD_NAME__CRS, status = acpi_walk_resources(mem_device->device->handle, METHOD_NAME__CRS, acpi_memory_get_resource, mem_device); if (ACPI_FAILURE(status)) { list_for_each_entry_safe(info, n, &mem_device->res_list, list) Loading Loading @@ -192,7 +192,7 @@ static int acpi_memory_check_device(struct acpi_memory_device *mem_device) /* Get device present/absent information from the _STA */ if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->handle, "_STA", if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->device->handle, "_STA", NULL, ¤t_status))) return -ENODEV; /* Loading Loading @@ -222,7 +222,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) return result; } node = acpi_get_node(mem_device->handle); node = acpi_get_node(mem_device->device->handle); /* * Tell the VM there is more memory here... * Note: Assume that this function returns zero on success Loading Loading @@ -269,7 +269,7 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device) arg_list.pointer = &arg; arg.type = ACPI_TYPE_INTEGER; arg.integer.value = 1; status = acpi_evaluate_object(mem_device->handle, status = acpi_evaluate_object(mem_device->device->handle, "_EJ0", &arg_list, NULL); /* Return on _EJ0 failure */ if (ACPI_FAILURE(status)) { Loading @@ -278,7 +278,7 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device) } /* Evalute _STA to check if the device is disabled */ status = acpi_evaluate_integer(mem_device->handle, "_STA", status = acpi_evaluate_integer(mem_device->device->handle, "_STA", NULL, ¤t_status); if (ACPI_FAILURE(status)) return -ENODEV; Loading Loading @@ -398,7 +398,7 @@ static int acpi_memory_device_add(struct acpi_device *device) memset(mem_device, 0, sizeof(struct acpi_memory_device)); INIT_LIST_HEAD(&mem_device->res_list); mem_device->handle = device->handle; mem_device->device = device; sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME); sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS); acpi_driver_data(device) = mem_device; Loading
drivers/acpi/battery.c +10 −13 Original line number Diff line number Diff line Loading @@ -108,7 +108,7 @@ struct acpi_battery_trips { }; struct acpi_battery { acpi_handle handle; struct acpi_device * device; struct acpi_battery_flags flags; struct acpi_battery_trips trips; unsigned long alarm; Loading Loading @@ -138,7 +138,7 @@ acpi_battery_get_info(struct acpi_battery *battery, /* Evalute _BIF */ status = acpi_evaluate_object(battery->handle, "_BIF", NULL, &buffer); status = acpi_evaluate_object(battery->device->handle, "_BIF", NULL, &buffer); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BIF")); return -ENODEV; Loading Loading @@ -198,7 +198,7 @@ acpi_battery_get_status(struct acpi_battery *battery, /* Evalute _BST */ status = acpi_evaluate_object(battery->handle, "_BST", NULL, &buffer); status = acpi_evaluate_object(battery->device->handle, "_BST", NULL, &buffer); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST")); return -ENODEV; Loading Loading @@ -255,7 +255,7 @@ acpi_battery_set_alarm(struct acpi_battery *battery, unsigned long alarm) arg0.integer.value = alarm; status = acpi_evaluate_object(battery->handle, "_BTP", &arg_list, NULL); status = acpi_evaluate_object(battery->device->handle, "_BTP", &arg_list, NULL); if (ACPI_FAILURE(status)) return -ENODEV; Loading @@ -278,9 +278,7 @@ static int acpi_battery_check(struct acpi_battery *battery) if (!battery) return -EINVAL; result = acpi_bus_get_device(battery->handle, &device); if (result) return result; device = battery->device; result = acpi_bus_get_status(device); if (result) Loading @@ -305,7 +303,7 @@ static int acpi_battery_check(struct acpi_battery *battery) /* See if alarms are supported, and if so, set default */ status = acpi_get_handle(battery->handle, "_BTP", &handle); status = acpi_get_handle(battery->device->handle, "_BTP", &handle); if (ACPI_SUCCESS(status)) { battery->flags.alarm = 1; acpi_battery_set_alarm(battery, battery->trips.warning); Loading Loading @@ -662,8 +660,7 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data) if (!battery) return; if (acpi_bus_get_device(handle, &device)) return; device = battery->device; switch (event) { case ACPI_BATTERY_NOTIFY_STATUS: Loading Loading @@ -695,7 +692,7 @@ static int acpi_battery_add(struct acpi_device *device) return -ENOMEM; memset(battery, 0, sizeof(struct acpi_battery)); battery->handle = device->handle; battery->device = device; strcpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_BATTERY_CLASS); acpi_driver_data(device) = battery; Loading @@ -708,7 +705,7 @@ static int acpi_battery_add(struct acpi_device *device) if (result) goto end; status = acpi_install_notify_handler(battery->handle, status = acpi_install_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, acpi_battery_notify, battery); if (ACPI_FAILURE(status)) { Loading Loading @@ -740,7 +737,7 @@ static int acpi_battery_remove(struct acpi_device *device, int type) battery = (struct acpi_battery *)acpi_driver_data(device); status = acpi_remove_notify_handler(battery->handle, status = acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, acpi_battery_notify); Loading
drivers/acpi/button.c +4 −6 Original line number Diff line number Diff line Loading @@ -82,7 +82,6 @@ static struct acpi_driver acpi_button_driver = { }; struct acpi_button { acpi_handle handle; struct acpi_device *device; /* Fixed button kludge */ u8 type; unsigned long pushed; Loading Loading @@ -137,7 +136,7 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset) if (!button || !button->device) return 0; status = acpi_evaluate_integer(button->handle, "_LID", NULL, &state); status = acpi_evaluate_integer(button->device->handle, "_LID", NULL, &state); if (ACPI_FAILURE(status)) { seq_printf(seq, "state: unsupported\n"); } else { Loading Loading @@ -282,7 +281,7 @@ static acpi_status acpi_button_notify_fixed(void *data) if (!button) return AE_BAD_PARAMETER; acpi_button_notify(button->handle, ACPI_BUTTON_NOTIFY_STATUS, button); acpi_button_notify(button->device->handle, ACPI_BUTTON_NOTIFY_STATUS, button); return AE_OK; } Loading @@ -303,7 +302,6 @@ static int acpi_button_add(struct acpi_device *device) memset(button, 0, sizeof(struct acpi_button)); button->device = device; button->handle = device->handle; acpi_driver_data(device) = button; /* Loading Loading @@ -362,7 +360,7 @@ static int acpi_button_add(struct acpi_device *device) button); break; default: status = acpi_install_notify_handler(button->handle, status = acpi_install_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, acpi_button_notify, button); Loading Loading @@ -420,7 +418,7 @@ static int acpi_button_remove(struct acpi_device *device, int type) acpi_button_notify_fixed); break; default: status = acpi_remove_notify_handler(button->handle, status = acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, acpi_button_notify); break; Loading
drivers/acpi/fan.c +5 −5 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ static struct acpi_driver acpi_fan_driver = { }; struct acpi_fan { acpi_handle handle; struct acpi_device * device; }; /* -------------------------------------------------------------------------- Loading @@ -80,7 +80,7 @@ static int acpi_fan_read_state(struct seq_file *seq, void *offset) if (fan) { if (acpi_bus_get_power(fan->handle, &state)) if (acpi_bus_get_power(fan->device->handle, &state)) seq_printf(seq, "status: ERROR\n"); else seq_printf(seq, "status: %s\n", Loading Loading @@ -112,7 +112,7 @@ acpi_fan_write_state(struct file *file, const char __user * buffer, state_string[count] = '\0'; result = acpi_bus_set_power(fan->handle, result = acpi_bus_set_power(fan->device->handle, simple_strtoul(state_string, NULL, 0)); if (result) return result; Loading Loading @@ -191,12 +191,12 @@ static int acpi_fan_add(struct acpi_device *device) return -ENOMEM; memset(fan, 0, sizeof(struct acpi_fan)); fan->handle = device->handle; fan->device = device; strcpy(acpi_device_name(device), "Fan"); strcpy(acpi_device_class(device), ACPI_FAN_CLASS); acpi_driver_data(device) = fan; result = acpi_bus_get_power(fan->handle, &state); result = acpi_bus_get_power(device->handle, &state); if (result) { printk(KERN_ERR PREFIX "Reading power state\n"); goto end; Loading