Skip to content

Commit

Permalink
habanalabs: Use dev_get_drvdata
Browse files Browse the repository at this point in the history
Instead of using to_pci_dev + pci_get_drvdata,
use dev_get_drvdata to make code simpler.

Signed-off-by: Chuhong Yuan <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
  • Loading branch information
WillLester authored and ogabbay committed Sep 5, 2019
1 parent 209257f commit 30f2732
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/misc/habanalabs/habanalabs_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,7 @@ void destroy_hdev(struct hl_device *hdev)

static int hl_pmops_suspend(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct hl_device *hdev = pci_get_drvdata(pdev);
struct hl_device *hdev = dev_get_drvdata(dev);

pr_debug("Going to suspend PCI device\n");

Expand All @@ -310,8 +309,7 @@ static int hl_pmops_suspend(struct device *dev)

static int hl_pmops_resume(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct hl_device *hdev = pci_get_drvdata(pdev);
struct hl_device *hdev = dev_get_drvdata(dev);

pr_debug("Going to resume PCI device\n");

Expand Down

0 comments on commit 30f2732

Please sign in to comment.