Commit 505f6a88 authored by Patrick Mochel's avatar Patrick Mochel

[power] Update IDE to set suspend/resume methods in bus_type.

Instead of having each driver set them in their own drivers.
parent 222192df
...@@ -3330,10 +3330,6 @@ static ide_driver_t ide_cdrom_driver = { ...@@ -3330,10 +3330,6 @@ static ide_driver_t ide_cdrom_driver = {
.drives = LIST_HEAD_INIT(ide_cdrom_driver.drives), .drives = LIST_HEAD_INIT(ide_cdrom_driver.drives),
.start_power_step = ide_cdrom_start_power_step, .start_power_step = ide_cdrom_start_power_step,
.complete_power_step = ide_cdrom_complete_power_step, .complete_power_step = ide_cdrom_complete_power_step,
.gen_driver = {
.suspend = generic_ide_suspend,
.resume = generic_ide_resume,
}
}; };
static int idecd_open(struct inode * inode, struct file * file) static int idecd_open(struct inode * inode, struct file * file)
......
...@@ -1732,10 +1732,6 @@ static ide_driver_t idedisk_driver = { ...@@ -1732,10 +1732,6 @@ static ide_driver_t idedisk_driver = {
.drives = LIST_HEAD_INIT(idedisk_driver.drives), .drives = LIST_HEAD_INIT(idedisk_driver.drives),
.start_power_step = idedisk_start_power_step, .start_power_step = idedisk_start_power_step,
.complete_power_step = idedisk_complete_power_step, .complete_power_step = idedisk_complete_power_step,
.gen_driver = {
.suspend = generic_ide_suspend,
.resume = generic_ide_resume,
}
}; };
static int idedisk_open(struct inode *inode, struct file *filp) static int idedisk_open(struct inode *inode, struct file *filp)
......
...@@ -1534,16 +1534,13 @@ int ata_attach(ide_drive_t *drive) ...@@ -1534,16 +1534,13 @@ int ata_attach(ide_drive_t *drive)
EXPORT_SYMBOL(ata_attach); EXPORT_SYMBOL(ata_attach);
int generic_ide_suspend(struct device *dev, u32 state, u32 level) static int generic_ide_suspend(struct device *dev, u32 state)
{ {
ide_drive_t *drive = dev->driver_data; ide_drive_t *drive = dev->driver_data;
struct request rq; struct request rq;
struct request_pm_state rqpm; struct request_pm_state rqpm;
ide_task_t args; ide_task_t args;
if (level == dev->power_state || level != SUSPEND_SAVE_STATE)
return 0;
memset(&rq, 0, sizeof(rq)); memset(&rq, 0, sizeof(rq));
memset(&rqpm, 0, sizeof(rqpm)); memset(&rqpm, 0, sizeof(rqpm));
memset(&args, 0, sizeof(args)); memset(&args, 0, sizeof(args));
...@@ -1556,18 +1553,13 @@ int generic_ide_suspend(struct device *dev, u32 state, u32 level) ...@@ -1556,18 +1553,13 @@ int generic_ide_suspend(struct device *dev, u32 state, u32 level)
return ide_do_drive_cmd(drive, &rq, ide_wait); return ide_do_drive_cmd(drive, &rq, ide_wait);
} }
EXPORT_SYMBOL(generic_ide_suspend); static int generic_ide_resume(struct device *dev)
int generic_ide_resume(struct device *dev, u32 level)
{ {
ide_drive_t *drive = dev->driver_data; ide_drive_t *drive = dev->driver_data;
struct request rq; struct request rq;
struct request_pm_state rqpm; struct request_pm_state rqpm;
ide_task_t args; ide_task_t args;
if (level == dev->power_state || level != RESUME_RESTORE_STATE)
return 0;
memset(&rq, 0, sizeof(rq)); memset(&rq, 0, sizeof(rq));
memset(&rqpm, 0, sizeof(rqpm)); memset(&rqpm, 0, sizeof(rqpm));
memset(&args, 0, sizeof(args)); memset(&args, 0, sizeof(args));
...@@ -1580,8 +1572,6 @@ int generic_ide_resume(struct device *dev, u32 level) ...@@ -1580,8 +1572,6 @@ int generic_ide_resume(struct device *dev, u32 level)
return ide_do_drive_cmd(drive, &rq, ide_head_wait); return ide_do_drive_cmd(drive, &rq, ide_head_wait);
} }
EXPORT_SYMBOL(generic_ide_resume);
int generic_ide_ioctl(struct block_device *bdev, unsigned int cmd, int generic_ide_ioctl(struct block_device *bdev, unsigned int cmd,
unsigned long arg) unsigned long arg)
{ {
...@@ -2594,6 +2584,8 @@ EXPORT_SYMBOL(ide_probe); ...@@ -2594,6 +2584,8 @@ EXPORT_SYMBOL(ide_probe);
struct bus_type ide_bus_type = { struct bus_type ide_bus_type = {
.name = "ide", .name = "ide",
.suspend = generic_ide_suspend,
.resume = generic_ide_resume,
}; };
/* /*
......
...@@ -1241,8 +1241,6 @@ typedef struct ide_driver_s { ...@@ -1241,8 +1241,6 @@ typedef struct ide_driver_s {
#define DRIVER(drive) ((drive)->driver) #define DRIVER(drive) ((drive)->driver)
extern int generic_ide_ioctl(struct block_device *, unsigned, unsigned long); extern int generic_ide_ioctl(struct block_device *, unsigned, unsigned long);
extern int generic_ide_suspend(struct device *dev, u32 state, u32 level);
extern int generic_ide_resume(struct device *dev, u32 level);
/* /*
* IDE modules. * IDE modules.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment