diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2019-12-10 10:53:49 -0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-12-25 20:48:32 -0700 |
commit | 7de9b1688c1d4a4c9267e65338ae8d6d0d025625 (patch) | |
tree | a63f9d7405e4399adf515e7cd9beb01fbccafe6a /drivers/ata | |
parent | 3c696ac4173678b62e74e26644d9f3d662973bfa (diff) |
ata: ahci_brcm: Add a shutdown callback
Make sure that we quiesce the controller and shut down the clocks in a
shutdown callback.
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/ahci_brcm.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c index 76612577a59a..58e1a6e5478d 100644 --- a/drivers/ata/ahci_brcm.c +++ b/drivers/ata/ahci_brcm.c @@ -532,11 +532,26 @@ static int brcm_ahci_remove(struct platform_device *pdev) return 0; } +static void brcm_ahci_shutdown(struct platform_device *pdev) +{ + int ret; + + /* All resources releasing happens via devres, but our device, unlike a + * proper remove is not disappearing, therefore using + * brcm_ahci_suspend() here which does explicit power management is + * appropriate. + */ + ret = brcm_ahci_suspend(&pdev->dev); + if (ret) + dev_err(&pdev->dev, "failed to shutdown\n"); +} + static SIMPLE_DEV_PM_OPS(ahci_brcm_pm_ops, brcm_ahci_suspend, brcm_ahci_resume); static struct platform_driver brcm_ahci_driver = { .probe = brcm_ahci_probe, .remove = brcm_ahci_remove, + .shutdown = brcm_ahci_shutdown, .driver = { .name = DRV_NAME, .of_match_table = ahci_of_match, |