Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312734
b: refs/heads/master
c: 62fcbdd
h: refs/heads/master
v: v3
  • Loading branch information
Rafael J. Wysocki committed Jul 1, 2012
1 parent 82ec474 commit 4d0d059
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 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: 67699c5f0c68f5dc49e92b172d372c99cdd2bf09
refs/heads/master: 62fcbdd95ccabcff7b41a859032496f6ca492045
21 changes: 11 additions & 10 deletions trunk/drivers/acpi/fan.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,26 @@ MODULE_LICENSE("GPL");

static int acpi_fan_add(struct acpi_device *device);
static int acpi_fan_remove(struct acpi_device *device, int type);
static int acpi_fan_suspend(struct acpi_device *device);
static int acpi_fan_resume(struct acpi_device *device);

static const struct acpi_device_id fan_device_ids[] = {
{"PNP0C0B", 0},
{"", 0},
};
MODULE_DEVICE_TABLE(acpi, fan_device_ids);

static int acpi_fan_suspend(struct device *dev);
static int acpi_fan_resume(struct device *dev);
static SIMPLE_DEV_PM_OPS(acpi_fan_pm, acpi_fan_suspend, acpi_fan_resume);

static struct acpi_driver acpi_fan_driver = {
.name = "fan",
.class = ACPI_FAN_CLASS,
.ids = fan_device_ids,
.ops = {
.add = acpi_fan_add,
.remove = acpi_fan_remove,
.suspend = acpi_fan_suspend,
.resume = acpi_fan_resume,
},
.drv.pm = &acpi_fan_pm,
};

/* thermal cooling device callbacks */
Expand Down Expand Up @@ -183,24 +184,24 @@ static int acpi_fan_remove(struct acpi_device *device, int type)
return 0;
}

static int acpi_fan_suspend(struct acpi_device *device)
static int acpi_fan_suspend(struct device *dev)
{
if (!device)
if (!dev)
return -EINVAL;

acpi_bus_set_power(device->handle, ACPI_STATE_D0);
acpi_bus_set_power(to_acpi_device(dev)->handle, ACPI_STATE_D0);

return AE_OK;
}

static int acpi_fan_resume(struct acpi_device *device)
static int acpi_fan_resume(struct device *dev)
{
int result;

if (!device)
if (!dev)
return -EINVAL;

result = acpi_bus_update_power(device->handle, NULL);
result = acpi_bus_update_power(to_acpi_device(dev)->handle, NULL);
if (result)
printk(KERN_ERR PREFIX "Error updating fan power state\n");

Expand Down

0 comments on commit 4d0d059

Please sign in to comment.