Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154203
b: refs/heads/master
c: cdd5b8c
h: refs/heads/master
i:
  154201: c7943d3
  154199: 7ad6cf5
v: v3
  • Loading branch information
Bjorn Helgaas authored and Len Brown committed Jun 18, 2009
1 parent 0444e34 commit 6cc8974
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aa8a149c0cc822e3886eb85b95cb2f7d67e5b7e6
refs/heads/master: cdd5b8ca122cc4239375dee7fcdc658315c119e4
32 changes: 11 additions & 21 deletions trunk/drivers/acpi/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,14 +450,13 @@ int acpi_bus_receive_event(struct acpi_bus_event *event)
Notification Handling
-------------------------------------------------------------------------- */

static int acpi_bus_check_device(struct acpi_device *device)
static void acpi_bus_check_device(struct acpi_device *device)
{
acpi_status status = 0;
acpi_status status;
struct acpi_device_status old_status;


if (!device)
return -EINVAL;
return;

old_status = device->status;

Expand All @@ -467,15 +466,15 @@ static int acpi_bus_check_device(struct acpi_device *device)
*/
if (device->parent && !device->parent->status.present) {
device->status = device->parent->status;
return 0;
return;
}

status = acpi_bus_get_status(device);
if (ACPI_FAILURE(status))
return -ENODEV;
return;

if (STRUCT_TO_INT(old_status) == STRUCT_TO_INT(device->status))
return 0;
return;

/*
* Device Insertion/Removal
Expand All @@ -487,28 +486,20 @@ static int acpi_bus_check_device(struct acpi_device *device)
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device removal detected\n"));
/* TBD: Handle device removal */
}

return 0;
}

static int acpi_bus_check_scope(struct acpi_device *device)
static void acpi_bus_check_scope(struct acpi_device *device)
{
int result = 0;

if (!device)
return -EINVAL;
return;

/* Status Change? */
result = acpi_bus_check_device(device);
if (result)
return result;
acpi_bus_check_device(device);

/*
* TBD: Enumerate child devices within this device's scope and
* run acpi_bus_check_device()'s on them.
*/

return 0;
}

static BLOCKING_NOTIFIER_HEAD(acpi_bus_notify_list);
Expand All @@ -531,7 +522,6 @@ EXPORT_SYMBOL_GPL(unregister_acpi_bus_notifier);
*/
static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
{
int result = 0;
struct acpi_device *device = NULL;
struct acpi_driver *driver;

Expand All @@ -547,15 +537,15 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
switch (type) {

case ACPI_NOTIFY_BUS_CHECK:
result = acpi_bus_check_scope(device);
acpi_bus_check_scope(device);
/*
* TBD: We'll need to outsource certain events to non-ACPI
* drivers via the device manager (device.c).
*/
break;

case ACPI_NOTIFY_DEVICE_CHECK:
result = acpi_bus_check_device(device);
acpi_bus_check_device(device);
/*
* TBD: We'll need to outsource certain events to non-ACPI
* drivers via the device manager (device.c).
Expand Down

0 comments on commit 6cc8974

Please sign in to comment.