diff options
author | Chuhong Yuan | 2019-07-23 07:50:14 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab | 2019-07-25 06:45:10 -0400 |
commit | bfe655d159af96632f4930c718e0fc5689460f98 (patch) | |
tree | b8a240978ae690a7075c785d82adcea23e0f336b /drivers/media/pci/pt1 | |
parent | 913c55a86400e0b3c99164a71a826ffb860c26c4 (diff) |
media: pci: Use dev_get_drvdata where possible
Instead of using to_pci_dev + pci_get_drvdata,
use dev_get_drvdata to make code simpler.
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/pci/pt1')
-rw-r--r-- | drivers/media/pci/pt1/pt1.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/pci/pt1/pt1.c b/drivers/media/pci/pt1/pt1.c index e51c80bc4646..72b191cfeb54 100644 --- a/drivers/media/pci/pt1/pt1.c +++ b/drivers/media/pci/pt1/pt1.c @@ -1217,8 +1217,7 @@ static void pt1_i2c_init(struct pt1 *pt1) static int pt1_suspend(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct pt1 *pt1 = pci_get_drvdata(pdev); + struct pt1 *pt1 = dev_get_drvdata(dev); pt1_init_streams(pt1); pt1_disable_ram(pt1); @@ -1230,8 +1229,7 @@ static int pt1_suspend(struct device *dev) static int pt1_resume(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct pt1 *pt1 = pci_get_drvdata(pdev); + struct pt1 *pt1 = dev_get_drvdata(dev); int ret; int i; |