mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-26 13:44:15 +08:00
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>
This commit is contained in:
parent
3c696ac417
commit
7de9b1688c
@ -532,11 +532,26 @@ static int brcm_ahci_remove(struct platform_device *pdev)
|
|||||||
return 0;
|
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 SIMPLE_DEV_PM_OPS(ahci_brcm_pm_ops, brcm_ahci_suspend, brcm_ahci_resume);
|
||||||
|
|
||||||
static struct platform_driver brcm_ahci_driver = {
|
static struct platform_driver brcm_ahci_driver = {
|
||||||
.probe = brcm_ahci_probe,
|
.probe = brcm_ahci_probe,
|
||||||
.remove = brcm_ahci_remove,
|
.remove = brcm_ahci_remove,
|
||||||
|
.shutdown = brcm_ahci_shutdown,
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = DRV_NAME,
|
.name = DRV_NAME,
|
||||||
.of_match_table = ahci_of_match,
|
.of_match_table = ahci_of_match,
|
||||||
|
Loading…
Reference in New Issue
Block a user