Skip to content

Commit d9a2a92

Browse files
VARoDeKmiquelraynal
authored andcommitted
mtd: rawnand: cafe: Use generic power management
Switch from PCI power management to the generic power management framework so the pci_driver hooks can eventually be retired. Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com> Reviewed-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
1 parent d86e70e commit d9a2a92

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

drivers/mtd/nand/raw/cafe_nand.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -837,9 +837,10 @@ static const struct pci_device_id cafe_nand_tbl[] = {
837837

838838
MODULE_DEVICE_TABLE(pci, cafe_nand_tbl);
839839

840-
static int cafe_nand_resume(struct pci_dev *pdev)
840+
static int cafe_nand_resume(struct device *dev)
841841
{
842842
uint32_t ctrl;
843+
struct pci_dev *pdev = to_pci_dev(dev);
843844
struct mtd_info *mtd = pci_get_drvdata(pdev);
844845
struct nand_chip *chip = mtd_to_nand(mtd);
845846
struct cafe_priv *cafe = nand_get_controller_data(chip);
@@ -877,12 +878,14 @@ static int cafe_nand_resume(struct pci_dev *pdev)
877878
return 0;
878879
}
879880

881+
static DEFINE_SIMPLE_DEV_PM_OPS(cafe_nand_ops, NULL, cafe_nand_resume);
882+
880883
static struct pci_driver cafe_nand_pci_driver = {
881884
.name = "CAFÉ NAND",
882885
.id_table = cafe_nand_tbl,
883886
.probe = cafe_nand_probe,
884887
.remove = cafe_nand_remove,
885-
.resume = cafe_nand_resume,
888+
.driver.pm = &cafe_nand_ops,
886889
};
887890

888891
module_pci_driver(cafe_nand_pci_driver);

0 commit comments

Comments
 (0)