Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 58eb8cd5 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Tejun Heo
Browse files

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: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent a3464ed2
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ static bool acard_ahci_qc_fill_rtf(struct ata_queued_cmd *qc);
static int acard_ahci_port_start(struct ata_port *ap);
static int acard_ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);

#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
static int acard_ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
static int acard_ahci_pci_device_resume(struct pci_dev *pdev);
#endif
@@ -118,13 +118,13 @@ static struct pci_driver acard_ahci_pci_driver = {
	.id_table		= acard_ahci_pci_tbl,
	.probe			= acard_ahci_init_one,
	.remove			= ata_pci_remove_one,
#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
	.suspend		= acard_ahci_pci_device_suspend,
	.resume			= acard_ahci_pci_device_resume,
#endif
};

#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
static int acard_ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg)
{
	struct ata_host *host = pci_get_drvdata(pdev);
+1 −1
Original line number Diff line number Diff line
@@ -241,7 +241,7 @@ static struct pci_driver ata_generic_pci_driver = {
	.id_table	= ata_generic,
	.probe 		= ata_generic_init_one,
	.remove		= ata_pci_remove_one,
#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
	.suspend	= ata_pci_device_suspend,
	.resume		= ata_pci_device_resume,
#endif
+2 −2
Original line number Diff line number Diff line
@@ -830,7 +830,7 @@ static bool piix_irq_check(struct ata_port *ap)
	return ap->ops->bmdma_status(ap) & ATA_DMA_INTR;
}

#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
static int piix_broken_suspend(void)
{
	static const struct dmi_system_id sysids[] = {
@@ -1767,7 +1767,7 @@ static struct pci_driver piix_pci_driver = {
	.id_table		= piix_pci_tbl,
	.probe			= piix_init_one,
	.remove			= piix_remove_one,
#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
	.suspend		= piix_pci_device_suspend,
	.resume			= piix_pci_device_resume,
#endif
+1 −1
Original line number Diff line number Diff line
@@ -265,7 +265,7 @@ static struct pci_driver pacpi_pci_driver = {
	.id_table		= pacpi_pci_tbl,
	.probe			= pacpi_init_one,
	.remove			= ata_pci_remove_one,
#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
	.suspend		= ata_pci_device_suspend,
	.resume			= ata_pci_device_resume,
#endif
+2 −2
Original line number Diff line number Diff line
@@ -589,7 +589,7 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
		return ata_pci_bmdma_init_one(pdev, ppi, &ali_sht, NULL, 0);
}

#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
static int ali_reinit_one(struct pci_dev *pdev)
{
	struct ata_host *host = pci_get_drvdata(pdev);
@@ -616,7 +616,7 @@ static struct pci_driver ali_pci_driver = {
	.id_table	= ali,
	.probe 		= ali_init_one,
	.remove		= ata_pci_remove_one,
#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
	.suspend	= ata_pci_device_suspend,
	.resume		= ali_reinit_one,
#endif
Loading