Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 311467
b: refs/heads/master
c: a606dac
h: refs/heads/master
i:
  311465: 24604e5
  311463: c84651f
v: v3
  • Loading branch information
Lin Ming authored and Jeff Garzik committed Jun 29, 2012
1 parent b48c2fc commit 16505a8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3bd46600a7a7e938c54df8cdbac9910668c7dfb0
refs/heads/master: a606dac368eed5696fb38e16b1394f1d049c09e9
2 changes: 2 additions & 0 deletions trunk/drivers/acpi/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ void acpi_power_resource_unregister_device(struct device *dev, acpi_handle handl
__acpi_power_resource_unregister_device(dev,
list->handles[i]);
}
EXPORT_SYMBOL_GPL(acpi_power_resource_unregister_device);

static int __acpi_power_resource_register_device(
struct acpi_power_managed_device *powered_device, acpi_handle handle)
Expand Down Expand Up @@ -460,6 +461,7 @@ int acpi_power_resource_register_device(struct device *dev, acpi_handle handle)
printk(KERN_WARNING PREFIX "Invalid Power Resource to register!");
return -ENODEV;
}
EXPORT_SYMBOL_GPL(acpi_power_resource_register_device);

/**
* acpi_device_sleep_wake - execute _DSW (Device Sleep Wake) or (deprecated in
Expand Down
32 changes: 32 additions & 0 deletions trunk/drivers/ata/libata-acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1025,14 +1025,46 @@ static void ata_acpi_remove_pm_notifier(struct ata_device *dev)
}
}

static void ata_acpi_register_power_resource(struct ata_device *dev)
{
struct scsi_device *sdev = dev->sdev;
acpi_handle handle;
struct device *device;

handle = ata_dev_acpi_handle(dev);
if (!handle)
return;

device = &sdev->sdev_gendev;

acpi_power_resource_register_device(device, handle);
}

static void ata_acpi_unregister_power_resource(struct ata_device *dev)
{
struct scsi_device *sdev = dev->sdev;
acpi_handle handle;
struct device *device;

handle = ata_dev_acpi_handle(dev);
if (!handle)
return;

device = &sdev->sdev_gendev;

acpi_power_resource_unregister_device(device, handle);
}

void ata_acpi_bind(struct ata_device *dev)
{
ata_acpi_add_pm_notifier(dev);
ata_acpi_register_power_resource(dev);
}

void ata_acpi_unbind(struct ata_device *dev)
{
ata_acpi_remove_pm_notifier(dev);
ata_acpi_unregister_power_resource(dev);
}

static int compat_pci_ata(struct ata_port *ap)
Expand Down

0 comments on commit 16505a8

Please sign in to comment.