Skip to content

Commit 9e266ec

Browse files
Aaron Lurustyrussell
authored andcommitted
virtio_pci: pm: Use CONFIG_PM_SLEEP instead of CONFIG_PM
The virtio_pci_freeze/restore are defined under CONFIG_PM but is used by SET_SYSTEM_SLEEP_PM_OPS macro, which is defined under CONFIG_PM_SLEEP. So if CONFIG_PM_SLEEP is not cofigured but CONFIG_PM_RUNTIME is, the following warning message appeared: drivers/virtio/virtio_pci.c:770:12: warning: ‘virtio_pci_freeze’ defined but not used [-Wunused-function] static int virtio_pci_freeze(struct device *dev) ^ drivers/virtio/virtio_pci.c:790:12: warning: ‘virtio_pci_restore’ defined but not used [-Wunused-function] static int virtio_pci_restore(struct device *dev) ^ Fix it by changing CONFIG_PM to CONFIG_PM_SLEEP. Signed-off-by: Aaron Lu <aaron.lu@intel.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent aa96a3c commit 9e266ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/virtio/virtio_pci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ static void virtio_pci_remove(struct pci_dev *pci_dev)
766766
kfree(vp_dev);
767767
}
768768

769-
#ifdef CONFIG_PM
769+
#ifdef CONFIG_PM_SLEEP
770770
static int virtio_pci_freeze(struct device *dev)
771771
{
772772
struct pci_dev *pci_dev = to_pci_dev(dev);
@@ -824,7 +824,7 @@ static struct pci_driver virtio_pci_driver = {
824824
.id_table = virtio_pci_id_table,
825825
.probe = virtio_pci_probe,
826826
.remove = virtio_pci_remove,
827-
#ifdef CONFIG_PM
827+
#ifdef CONFIG_PM_SLEEP
828828
.driver.pm = &virtio_pci_pm_ops,
829829
#endif
830830
};

0 commit comments

Comments
 (0)