mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
Merge branches 'acpi-pnp' and 'acpi-pci'
* acpi-pnp: ACPI / PNP: Use ACPI_COMPANION() instead of ACPI_HANDLE() ACPI / PNP: do ACPI binding directly * acpi-pci: ACPI / PCI: Use ACPI_COMPANION() instead of ACPI_HANDLE()
This commit is contained in:
commit
91af125c33
4 changed files with 35 additions and 77 deletions
|
|
@ -150,14 +150,13 @@ static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev)
|
|||
|
||||
static bool acpi_pci_power_manageable(struct pci_dev *dev)
|
||||
{
|
||||
acpi_handle handle = ACPI_HANDLE(&dev->dev);
|
||||
|
||||
return handle ? acpi_bus_power_manageable(handle) : false;
|
||||
struct acpi_device *adev = ACPI_COMPANION(&dev->dev);
|
||||
return adev ? acpi_device_power_manageable(adev) : false;
|
||||
}
|
||||
|
||||
static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state)
|
||||
{
|
||||
acpi_handle handle = ACPI_HANDLE(&dev->dev);
|
||||
struct acpi_device *adev = ACPI_COMPANION(&dev->dev);
|
||||
static const u8 state_conv[] = {
|
||||
[PCI_D0] = ACPI_STATE_D0,
|
||||
[PCI_D1] = ACPI_STATE_D1,
|
||||
|
|
@ -168,7 +167,7 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state)
|
|||
int error = -EINVAL;
|
||||
|
||||
/* If the ACPI device has _EJ0, ignore the device */
|
||||
if (!handle || acpi_has_method(handle, "_EJ0"))
|
||||
if (!adev || acpi_has_method(adev->handle, "_EJ0"))
|
||||
return -ENODEV;
|
||||
|
||||
switch (state) {
|
||||
|
|
@ -182,7 +181,7 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state)
|
|||
case PCI_D1:
|
||||
case PCI_D2:
|
||||
case PCI_D3hot:
|
||||
error = acpi_bus_set_power(handle, state_conv[state]);
|
||||
error = acpi_device_set_power(adev, state_conv[state]);
|
||||
}
|
||||
|
||||
if (!error)
|
||||
|
|
@ -194,9 +193,8 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state)
|
|||
|
||||
static bool acpi_pci_can_wakeup(struct pci_dev *dev)
|
||||
{
|
||||
acpi_handle handle = ACPI_HANDLE(&dev->dev);
|
||||
|
||||
return handle ? acpi_bus_can_wakeup(handle) : false;
|
||||
struct acpi_device *adev = ACPI_COMPANION(&dev->dev);
|
||||
return adev ? acpi_device_can_wakeup(adev) : false;
|
||||
}
|
||||
|
||||
static void acpi_pci_propagate_wakeup_enable(struct pci_bus *bus, bool enable)
|
||||
|
|
|
|||
Loading…
Reference in a new issue