diff options
author | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2014-05-07 11:17:44 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-05-09 22:37:49 -0400 |
commit | 58eb8cd565af4a104395e3c10443951c1f73dafe (patch) | |
tree | 127ce4daca1f66218d2b72712c6b4e50ecc740bd /drivers/ata/pata_macio.c | |
parent | a3464ed2f14d19ba923930f7c0c284499d64eb5b (diff) |
ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers
This patch fixes host drivers to use CONFIG_PM_SLEEP instead of CONFIG_PM
where applicable. Benefits of this change:
* unused code is not being compiled in for CONFIG_PM=y, CONFIG_PM_SLEEP=n
and CONFIG_PM_RUNTIME=y configurations
* easier transition to use struct dev_pm_ops and SIMPLE_DEV_PM_OPS() in
the future
* more consistent code (there are host drivers which are using the correct
CONFIG_PM_SLEEP checks already)
The patch leaves the core libata code and ->port_[suspend,resume] support
in sata_[inic162x,nv,sil24].c alone for now.
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata/pata_macio.c')
-rw-r--r-- | drivers/ata/pata_macio.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c index c28d0645e851..a02f76fdcfcd 100644 --- a/drivers/ata/pata_macio.c +++ b/drivers/ata/pata_macio.c | |||
@@ -845,8 +845,7 @@ static int pata_macio_slave_config(struct scsi_device *sdev) | |||
845 | return 0; | 845 | return 0; |
846 | } | 846 | } |
847 | 847 | ||
848 | #ifdef CONFIG_PM | 848 | #ifdef CONFIG_PM_SLEEP |
849 | |||
850 | static int pata_macio_do_suspend(struct pata_macio_priv *priv, pm_message_t mesg) | 849 | static int pata_macio_do_suspend(struct pata_macio_priv *priv, pm_message_t mesg) |
851 | { | 850 | { |
852 | int rc; | 851 | int rc; |
@@ -907,8 +906,7 @@ static int pata_macio_do_resume(struct pata_macio_priv *priv) | |||
907 | 906 | ||
908 | return 0; | 907 | return 0; |
909 | } | 908 | } |
910 | 909 | #endif /* CONFIG_PM_SLEEP */ | |
911 | #endif /* CONFIG_PM */ | ||
912 | 910 | ||
913 | static struct scsi_host_template pata_macio_sht = { | 911 | static struct scsi_host_template pata_macio_sht = { |
914 | ATA_BASE_SHT(DRV_NAME), | 912 | ATA_BASE_SHT(DRV_NAME), |
@@ -1208,8 +1206,7 @@ static int pata_macio_detach(struct macio_dev *mdev) | |||
1208 | return 0; | 1206 | return 0; |
1209 | } | 1207 | } |
1210 | 1208 | ||
1211 | #ifdef CONFIG_PM | 1209 | #ifdef CONFIG_PM_SLEEP |
1212 | |||
1213 | static int pata_macio_suspend(struct macio_dev *mdev, pm_message_t mesg) | 1210 | static int pata_macio_suspend(struct macio_dev *mdev, pm_message_t mesg) |
1214 | { | 1211 | { |
1215 | struct ata_host *host = macio_get_drvdata(mdev); | 1212 | struct ata_host *host = macio_get_drvdata(mdev); |
@@ -1223,8 +1220,7 @@ static int pata_macio_resume(struct macio_dev *mdev) | |||
1223 | 1220 | ||
1224 | return pata_macio_do_resume(host->private_data); | 1221 | return pata_macio_do_resume(host->private_data); |
1225 | } | 1222 | } |
1226 | 1223 | #endif /* CONFIG_PM_SLEEP */ | |
1227 | #endif /* CONFIG_PM */ | ||
1228 | 1224 | ||
1229 | #ifdef CONFIG_PMAC_MEDIABAY | 1225 | #ifdef CONFIG_PMAC_MEDIABAY |
1230 | static void pata_macio_mb_event(struct macio_dev* mdev, int mb_state) | 1226 | static void pata_macio_mb_event(struct macio_dev* mdev, int mb_state) |
@@ -1316,8 +1312,7 @@ static void pata_macio_pci_detach(struct pci_dev *pdev) | |||
1316 | ata_host_detach(host); | 1312 | ata_host_detach(host); |
1317 | } | 1313 | } |
1318 | 1314 | ||
1319 | #ifdef CONFIG_PM | 1315 | #ifdef CONFIG_PM_SLEEP |
1320 | |||
1321 | static int pata_macio_pci_suspend(struct pci_dev *pdev, pm_message_t mesg) | 1316 | static int pata_macio_pci_suspend(struct pci_dev *pdev, pm_message_t mesg) |
1322 | { | 1317 | { |
1323 | struct ata_host *host = pci_get_drvdata(pdev); | 1318 | struct ata_host *host = pci_get_drvdata(pdev); |
@@ -1331,8 +1326,7 @@ static int pata_macio_pci_resume(struct pci_dev *pdev) | |||
1331 | 1326 | ||
1332 | return pata_macio_do_resume(host->private_data); | 1327 | return pata_macio_do_resume(host->private_data); |
1333 | } | 1328 | } |
1334 | 1329 | #endif /* CONFIG_PM_SLEEP */ | |
1335 | #endif /* CONFIG_PM */ | ||
1336 | 1330 | ||
1337 | static struct of_device_id pata_macio_match[] = | 1331 | static struct of_device_id pata_macio_match[] = |
1338 | { | 1332 | { |
@@ -1360,7 +1354,7 @@ static struct macio_driver pata_macio_driver = | |||
1360 | }, | 1354 | }, |
1361 | .probe = pata_macio_attach, | 1355 | .probe = pata_macio_attach, |
1362 | .remove = pata_macio_detach, | 1356 | .remove = pata_macio_detach, |
1363 | #ifdef CONFIG_PM | 1357 | #ifdef CONFIG_PM_SLEEP |
1364 | .suspend = pata_macio_suspend, | 1358 | .suspend = pata_macio_suspend, |
1365 | .resume = pata_macio_resume, | 1359 | .resume = pata_macio_resume, |
1366 | #endif | 1360 | #endif |
@@ -1383,7 +1377,7 @@ static struct pci_driver pata_macio_pci_driver = { | |||
1383 | .id_table = pata_macio_pci_match, | 1377 | .id_table = pata_macio_pci_match, |
1384 | .probe = pata_macio_pci_attach, | 1378 | .probe = pata_macio_pci_attach, |
1385 | .remove = pata_macio_pci_detach, | 1379 | .remove = pata_macio_pci_detach, |
1386 | #ifdef CONFIG_PM | 1380 | #ifdef CONFIG_PM_SLEEP |
1387 | .suspend = pata_macio_pci_suspend, | 1381 | .suspend = pata_macio_pci_suspend, |
1388 | .resume = pata_macio_pci_resume, | 1382 | .resume = pata_macio_pci_resume, |
1389 | #endif | 1383 | #endif |