提交 7f142022 编写于 作者: B Bjorn Helgaas

agp/intel: Convert to generic power management

Convert agpgart-intel from legacy PCI power management to the generic power
management framework.

Previously agpgart-intel used legacy PCI power management, and
agp_intel_resume() was responsible for both device-specific things and
generic PCI things like saving and restoring config space and managing
power state.

In this case, agp_intel_suspend() was empty, and agp_intel_resume()
already did only device-specific things, so simply convert it to take a
struct device * instead of a struct pci_dev *.

Based on 0aeddbd0 ("via-agp: convert to generic power management") by
Vaibhav Gupta <vaibhavgupta40@gmail.com>.

Link: https://lore.kernel.org/r/20221025203852.681822-3-helgaas@kernel.orgSigned-off-by: NBjorn Helgaas <bhelgaas@google.com>
Acked-by: NDave Airlie <airlied@redhat.com>
上级 94e9f9a2
...@@ -817,16 +817,15 @@ static void agp_intel_remove(struct pci_dev *pdev) ...@@ -817,16 +817,15 @@ static void agp_intel_remove(struct pci_dev *pdev)
agp_put_bridge(bridge); agp_put_bridge(bridge);
} }
#ifdef CONFIG_PM static int agp_intel_resume(struct device *dev)
static int agp_intel_resume(struct pci_dev *pdev)
{ {
struct pci_dev *pdev = to_pci_dev(dev);
struct agp_bridge_data *bridge = pci_get_drvdata(pdev); struct agp_bridge_data *bridge = pci_get_drvdata(pdev);
bridge->driver->configure(); bridge->driver->configure();
return 0; return 0;
} }
#endif
static const struct pci_device_id agp_intel_pci_table[] = { static const struct pci_device_id agp_intel_pci_table[] = {
#define ID(x) \ #define ID(x) \
...@@ -895,14 +894,14 @@ static const struct pci_device_id agp_intel_pci_table[] = { ...@@ -895,14 +894,14 @@ static const struct pci_device_id agp_intel_pci_table[] = {
MODULE_DEVICE_TABLE(pci, agp_intel_pci_table); MODULE_DEVICE_TABLE(pci, agp_intel_pci_table);
static DEFINE_SIMPLE_DEV_PM_OPS(agp_intel_pm_ops, NULL, agp_intel_resume);
static struct pci_driver agp_intel_pci_driver = { static struct pci_driver agp_intel_pci_driver = {
.name = "agpgart-intel", .name = "agpgart-intel",
.id_table = agp_intel_pci_table, .id_table = agp_intel_pci_table,
.probe = agp_intel_probe, .probe = agp_intel_probe,
.remove = agp_intel_remove, .remove = agp_intel_remove,
#ifdef CONFIG_PM .driver.pm = &agp_intel_pm_ops,
.resume = agp_intel_resume,
#endif
}; };
static int __init agp_intel_init(void) static int __init agp_intel_init(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册