[PATCH 04/10] drm/i915: use pdev_to_i915() instead of pci_get_drvdata() directly

Gustavo Sousa gustavo.sousa at intel.com
Thu Aug 1 17:27:31 UTC 2024


Quoting Gustavo Sousa (2024-08-01 14:03:33-03:00)
>Quoting Jani Nikula (2024-07-29 11:30:05-03:00)
>>We have a helper for converting pci device to i915 device, use it.
>
>Any reason why i915_inject_probe_failure(pci_get_drvdata(pdev)) was not
>converted in i915_pci_probe()?

Hm... And after the next patch, that pci_get_drvdata(pdev) call seems to
be wrong (although it would work because of drm being at offset 0).

--
Gustavo Sousa

>
>--
>Gustavo Sousa
>
>>
>>Signed-off-by: Jani Nikula <jani.nikula at intel.com>
>>---
>> drivers/gpu/drm/i915/i915_pci.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>>diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
>>index ce4dfd65fafa..b2e1fd22520b 100644
>>--- a/drivers/gpu/drm/i915/i915_pci.c
>>+++ b/drivers/gpu/drm/i915/i915_pci.c
>>@@ -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;
>> 
>>@@ -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);
>> }
>>-- 
>>2.39.2
>>


More information about the Intel-gfx mailing list