use DEFINE_SIMPLE_DEV_PM_OPS for hl_pm_ops, pm_sleep_ptr() to safely drop the references without triggering compiler warnings. and add the value of '.freeze .thaw .poweroff .restore'. if these address are null, may cause error in s4.
Signed-off-by: Li Jun <[email protected]> --- drivers/accel/habanalabs/common/habanalabs_drv.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/accel/habanalabs/common/habanalabs_drv.c b/drivers/accel/habanalabs/common/habanalabs_drv.c index 483e1ad9fc41..6de59a9bac9b 100644 --- a/drivers/accel/habanalabs/common/habanalabs_drv.c +++ b/drivers/accel/habanalabs/common/habanalabs_drv.c @@ -706,10 +706,7 @@ static void hl_pci_reset_done(struct pci_dev *pdev) hl_device_reset(hdev, flags); } -static const struct dev_pm_ops hl_pm_ops = { - .suspend = hl_pmops_suspend, - .resume = hl_pmops_resume, -}; +static DEFINE_SIMPLE_DEV_PM_OPS(hl_pm_ops, hl_pmops_suspend, hl_pmops_resume); static const struct pci_error_handlers hl_pci_err_handler = { .error_detected = hl_pci_err_detected, -- 2.25.1
