Skip to content

Commit 0b22125

Browse files
committed
Merge branches 'acpi-scan', 'acpi-drivers', 'acpi-pm' and 'acpi-resources'
* acpi-scan: ACPI: bus: Introduce acpi_dev_get() and reuse it in ACPI code ACPI: scan: Utilize match_string() API ACPI: scan: Call acpi_get_object_info() from acpi_set_pnp_ids() ACPI: scan: Drop sta argument from acpi_init_device_object() ACPI: scan: Drop sta argument from acpi_add_single_object() ACPI: scan: Rearrange checks in acpi_bus_check_add() ACPI: scan: Fold acpi_bus_type_and_status() into its caller * acpi-drivers: ACPI: HED: Drop unused ACPI_MODULE_NAME() definition * acpi-pm: ACPI: power: Turn off unused power resources unconditionally ACPI: scan: Turn off unused power resources during initialization * acpi-resources: resource: Prevent irqresource_disabled() from erasing flags
5 parents ab49750 + 4cbaba4 + a13f779 + 7e4fdea + d08a745 commit 0b22125

9 files changed

Lines changed: 89 additions & 128 deletions

File tree

drivers/acpi/device_sysfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,12 +376,12 @@ eject_store(struct device *d, struct device_attribute *attr,
376376
if (ACPI_FAILURE(status) || !acpi_device->flags.ejectable)
377377
return -ENODEV;
378378

379-
get_device(&acpi_device->dev);
379+
acpi_dev_get(acpi_device);
380380
status = acpi_hotplug_schedule(acpi_device, ACPI_OST_EC_OSPM_EJECT);
381381
if (ACPI_SUCCESS(status))
382382
return count;
383383

384-
put_device(&acpi_device->dev);
384+
acpi_dev_put(acpi_device);
385385
acpi_evaluate_ost(acpi_device->handle, ACPI_OST_EC_OSPM_EJECT,
386386
ACPI_OST_SC_NON_SPECIFIC_FAILURE, NULL);
387387
return status == AE_NO_MEMORY ? -ENOMEM : -EAGAIN;

drivers/acpi/glue.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev)
190190
if (!acpi_dev)
191191
return -EINVAL;
192192

193-
get_device(&acpi_dev->dev);
193+
acpi_dev_get(acpi_dev);
194194
get_device(dev);
195195
physical_node = kzalloc(sizeof(*physical_node), GFP_KERNEL);
196196
if (!physical_node) {
@@ -217,7 +217,7 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev)
217217
goto err;
218218

219219
put_device(dev);
220-
put_device(&acpi_dev->dev);
220+
acpi_dev_put(acpi_dev);
221221
return 0;
222222
}
223223
if (pn->node_id == node_id) {
@@ -257,7 +257,7 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev)
257257
err:
258258
ACPI_COMPANION_SET(dev, NULL);
259259
put_device(dev);
260-
put_device(&acpi_dev->dev);
260+
acpi_dev_put(acpi_dev);
261261
return retval;
262262
}
263263
EXPORT_SYMBOL_GPL(acpi_bind_one);
@@ -285,7 +285,7 @@ int acpi_unbind_one(struct device *dev)
285285
ACPI_COMPANION_SET(dev, NULL);
286286
/* Drop references taken by acpi_bind_one(). */
287287
put_device(dev);
288-
put_device(&acpi_dev->dev);
288+
acpi_dev_put(acpi_dev);
289289
kfree(entry);
290290
break;
291291
}

drivers/acpi/hed.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ static struct acpi_driver acpi_hed_driver = {
7474
};
7575
module_acpi_driver(acpi_hed_driver);
7676

77-
ACPI_MODULE_NAME("hed");
7877
MODULE_AUTHOR("Huang Ying");
7978
MODULE_DESCRIPTION("ACPI Hardware Error Device Driver");
8079
MODULE_LICENSE("GPL");

drivers/acpi/internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ struct acpi_device_bus_id {
109109
int acpi_device_add(struct acpi_device *device,
110110
void (*release)(struct device *));
111111
void acpi_init_device_object(struct acpi_device *device, acpi_handle handle,
112-
int type, unsigned long long sta,
113-
struct acpi_device_info *info);
112+
int type);
114113
int acpi_device_setup_files(struct acpi_device *dev);
115114
void acpi_device_remove_files(struct acpi_device *dev);
116115
void acpi_device_add_finalize(struct acpi_device *device);
@@ -143,6 +142,7 @@ int acpi_device_sleep_wake(struct acpi_device *dev,
143142
int acpi_power_get_inferred_state(struct acpi_device *device, int *state);
144143
int acpi_power_on_resources(struct acpi_device *device, int state);
145144
int acpi_power_transition(struct acpi_device *device, int state);
145+
void acpi_turn_off_unused_power_resources(void);
146146

147147
/* --------------------------------------------------------------------------
148148
Device Power Management

drivers/acpi/power.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -925,8 +925,7 @@ int acpi_add_power_resource(acpi_handle handle)
925925
return -ENOMEM;
926926

927927
device = &resource->device;
928-
acpi_init_device_object(device, handle, ACPI_BUS_TYPE_POWER,
929-
ACPI_STA_DEFAULT, NULL);
928+
acpi_init_device_object(device, handle, ACPI_BUS_TYPE_POWER);
930929
mutex_init(&resource->resource_lock);
931930
INIT_LIST_HEAD(&resource->list_node);
932931
INIT_LIST_HEAD(&resource->dependents);
@@ -996,6 +995,7 @@ void acpi_resume_power_resources(void)
996995

997996
mutex_unlock(&power_resource_list_lock);
998997
}
998+
#endif
999999

10001000
void acpi_turn_off_unused_power_resources(void)
10011001
{
@@ -1004,18 +1004,9 @@ void acpi_turn_off_unused_power_resources(void)
10041004
mutex_lock(&power_resource_list_lock);
10051005

10061006
list_for_each_entry_reverse(resource, &acpi_power_resource_list, list_node) {
1007-
int result, state;
1008-
10091007
mutex_lock(&resource->resource_lock);
10101008

1011-
result = acpi_power_get_state(resource->device.handle, &state);
1012-
if (result) {
1013-
mutex_unlock(&resource->resource_lock);
1014-
continue;
1015-
}
1016-
1017-
if (state == ACPI_POWER_RESOURCE_STATE_ON
1018-
&& !resource->ref_count) {
1009+
if (!resource->ref_count) {
10191010
dev_info(&resource->device.dev, "Turning OFF\n");
10201011
__acpi_power_off(resource);
10211012
}
@@ -1025,4 +1016,3 @@ void acpi_turn_off_unused_power_resources(void)
10251016

10261017
mutex_unlock(&power_resource_list_lock);
10271018
}
1028-
#endif

0 commit comments

Comments
 (0)