From 2690864f78b3e331baf81000cf92f53c112b7d4f Mon Sep 17 00:00:00 2001 From: Yifeng Zhao Date: Mon, 16 May 2022 11:34:56 +0800 Subject: [PATCH] scsi: sata: move device_init_wakeup form ahci_platform.c to sd.c The "struct device *dev" in sd_resume is for the hard disk, and the correct device needs to be initialized for pm_stay_awake. Fixes: da1c2c4a2cc8 ("scsi: sata: re enter sleep is prohibited during wake-up") Signed-off-by: Yifeng Zhao Change-Id: Ic6c4a340672605ac64fc0778f6938898dee1b8eb --- drivers/ata/ahci_platform.c | 2 -- drivers/scsi/sd.c | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index 6988ef6b5c3c..1825b33cc274 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c @@ -74,8 +74,6 @@ static int ahci_probe(struct platform_device *pdev) if (rc) goto disable_resources; - device_init_wakeup(dev, true); - return 0; disable_resources: ahci_platform_disable_resources(hpriv); diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 8cf5d7ef7cc5..ade8a6c79e9c 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -3453,6 +3453,7 @@ static int sd_probe(struct device *dev) get_device(dev); dev_set_drvdata(dev, sdkp); + device_init_wakeup(dev, true); gd->major = sd_major((index & 0xf0) >> 4); gd->first_minor = ((index & 0xf) << 4) | (index & 0xfff00);