]> Git Repo - J-linux.git/commitdiff
drm/i915: use pdev_to_i915() instead of pci_get_drvdata() directly
authorJani Nikula <[email protected]>
Mon, 12 Aug 2024 10:34:15 +0000 (13:34 +0300)
committerJani Nikula <[email protected]>
Tue, 13 Aug 2024 08:00:24 +0000 (11:00 +0300)
We have a helper for converting pci device to i915 device, use it.

v2: Also convert i915_pci_probe() (Gustavo)

Reviewed-by: Gustavo Sousa <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Jani Nikula <[email protected]>
drivers/gpu/drm/i915/i915_pci.c

index ce4dfd65fafa585da2d90c8b5ee9e435460232f2..94c89ca2ef30e26adc0d72ecc9148a5c0481ee33 100644 (file)
@@ -880,7 +880,7 @@ static void i915_pci_remove(struct pci_dev *pdev)
 {
        struct drm_i915_private *i915;
 
-       i915 = pci_get_drvdata(pdev);
+       i915 = pdev_to_i915(pdev);
        if (!i915) /* driver load aborted, nothing to cleanup */
                return;
 
@@ -1003,7 +1003,7 @@ static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        if (err)
                return err;
 
-       if (i915_inject_probe_failure(pci_get_drvdata(pdev))) {
+       if (i915_inject_probe_failure(pdev_to_i915(pdev))) {
                i915_pci_remove(pdev);
                return -ENODEV;
        }
@@ -1025,7 +1025,7 @@ static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 static void i915_pci_shutdown(struct pci_dev *pdev)
 {
-       struct drm_i915_private *i915 = pci_get_drvdata(pdev);
+       struct drm_i915_private *i915 = pdev_to_i915(pdev);
 
        i915_driver_shutdown(i915);
 }
This page took 0.054044 seconds and 4 git commands to generate.