• Daniel Vetter's avatar
    drm/i915: Don't clear drvdata in ->release · 0ce542f7
    Daniel Vetter authored
    For two reasons:
    
    - The driver core clears this already for us after we're unloaded in
      __device_release_driver().
    
    - It's way too late, the drm_device ->release callback might massively
      outlive the underlying physical device, since a drm_device can be
      kept alive by open drm_file or well really anything else userspace
      is still hanging onto. So if we clear this ourselves, we should
      clear it in the pci ->remove callback, not in the drm_device
      ->release callback.
    
    Looking at git history this was fixed in the driver core with
    
    commit 0998d063
    Author: Hans de Goede <hdegoede@redhat.com>
    Date:   Wed May 23 00:09:34 2012 +0200
    
        device-core: Ensure drvdata = NULL when no driver is bound
    
    v2: Cite the core fix in the commit message (Chris).
    
    v3: Fix commit message and unused variable warning (Jani).
    
    Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Cc: Chris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-3-daniel.vetter@ffwll.ch
    0ce542f7
i915_drv.c 62.8 KB