]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
media: pci: Use dev_get_drvdata where possible
authorChuhong Yuan <hslester96@gmail.com>
Tue, 23 Jul 2019 11:50:14 +0000 (07:50 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 25 Jul 2019 10:45:10 +0000 (06:45 -0400)
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>
drivers/media/pci/intel/ipu3/ipu3-cio2.c
drivers/media/pci/pt1/pt1.c
drivers/media/pci/pt3/pt3.c

index c1d133e17e4b8bfc794784f1b828845f4ca154df..50a34bcd4d1454bbad03657e277c5b06f4bba202 100644 (file)
@@ -2000,8 +2000,7 @@ static int __maybe_unused cio2_suspend(struct device *dev)
 
 static int __maybe_unused cio2_resume(struct device *dev)
 {
-       struct pci_dev *pci_dev = to_pci_dev(dev);
-       struct cio2_device *cio2 = pci_get_drvdata(pci_dev);
+       struct cio2_device *cio2 = dev_get_drvdata(dev);
        int r = 0;
        struct cio2_queue *q = cio2->cur_queue;
 
index e51c80bc4646fca81080b8436219b8744b702687..72b191cfeb5483351d425f7ed68bb5763f0ea266 100644 (file)
@@ -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;
 
index 7a7afae4c84ce28dc557f551c776a366fdec1f9e..c0bc867933558e1818d61672831e693752d8719e 100644 (file)
@@ -626,8 +626,7 @@ static void pt3_cleanup_adapter(struct pt3_board *pt3, int index)
 
 static int pt3_suspend(struct device *dev)
 {
-       struct pci_dev *pdev = to_pci_dev(dev);
-       struct pt3_board *pt3 = pci_get_drvdata(pdev);
+       struct pt3_board *pt3 = dev_get_drvdata(dev);
        int i;
        struct pt3_adapter *adap;
 
@@ -646,8 +645,7 @@ static int pt3_suspend(struct device *dev)
 
 static int pt3_resume(struct device *dev)
 {
-       struct pci_dev *pdev = to_pci_dev(dev);
-       struct pt3_board *pt3 = pci_get_drvdata(pdev);
+       struct pt3_board *pt3 = dev_get_drvdata(dev);
        int i, ret;
        struct pt3_adapter *adap;