Commit ed87ad19 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Jens Axboe
Browse files

ata: brcm: mark PM functions as __maybe_unused



The new shutdown callback causes a link failure:

drivers/ata/ahci_brcm.c: In function 'brcm_ahci_shutdown':
drivers/ata/ahci_brcm.c:552:8: error: implicit declaration of function 'brcm_ahci_suspend'; did you mean 'brcm_ahci_shutdown'? [-Werror=implicit-function-declaration]
  ret = brcm_ahci_suspend(&pdev->dev);
        ^~~~~~~~~~~~~~~~~

Remove the incorrect #ifdef and use __maybe_unused annotations
instead to make this more robust.

Fixes: 7de9b168 ("ata: ahci_brcm: Add a shutdown callback")
Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent c345ec6a
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -338,7 +338,6 @@ static const struct ata_port_info ahci_brcm_port_info = {
	.port_ops	= &ahci_brcm_platform_ops,
};

#ifdef CONFIG_PM_SLEEP
static int brcm_ahci_suspend(struct device *dev)
{
	struct ata_host *host = dev_get_drvdata(dev);
@@ -348,7 +347,10 @@ static int brcm_ahci_suspend(struct device *dev)

	brcm_sata_phys_disable(priv);

	if (IS_ENABLED(CONFIG_PM_SLEEP))
		ret = ahci_platform_suspend(dev);
	else
		ret = 0;

	if (!IS_ERR_OR_NULL(priv->rcdev))
		reset_control_assert(priv->rcdev);
@@ -356,7 +358,7 @@ static int brcm_ahci_suspend(struct device *dev)
	return ret;
}

static int brcm_ahci_resume(struct device *dev)
static int __maybe_unused brcm_ahci_resume(struct device *dev)
{
	struct ata_host *host = dev_get_drvdata(dev);
	struct ahci_host_priv *hpriv = host->private_data;
@@ -405,7 +407,6 @@ out_disable_phys:
	ahci_platform_disable_clks(hpriv);
	return ret;
}
#endif

static struct scsi_host_template ahci_platform_sht = {
	AHCI_SHT(DRV_NAME),