[v2,1/6] drm/i915: add i915_driver_modeset_remove()

Submitted by Jani Nikula on Sept. 20, 2019, 6:54 p.m.

Details

Message ID 20190920185421.17822-1-jani.nikula@intel.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Jani Nikula Sept. 20, 2019, 6:54 p.m.
For completeness, add counterpart to i915_driver_modeset_probe() and
remove the asymmetry in the probe/remove parts. No functional changes.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 9904f762f4bb..4cb95fd9b35d 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -422,6 +422,20 @@  static int i915_driver_modeset_probe(struct drm_device *dev)
 	return ret;
 }
 
+static void i915_driver_modeset_remove(struct drm_i915_private *i915)
+{
+	struct pci_dev *pdev = i915->drm.pdev;
+
+	intel_modeset_driver_remove(&i915->drm);
+
+	intel_bios_driver_remove(i915);
+
+	vga_switcheroo_unregister_client(pdev);
+	vga_client_register(pdev, NULL, NULL, NULL);
+
+	intel_csr_ucode_fini(i915);
+}
+
 static void intel_init_dpio(struct drm_i915_private *dev_priv)
 {
 	/*
@@ -1586,8 +1600,6 @@  int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 void i915_driver_remove(struct drm_i915_private *i915)
 {
-	struct pci_dev *pdev = i915->drm.pdev;
-
 	disable_rpm_wakeref_asserts(&i915->runtime_pm);
 
 	i915_driver_unregister(i915);
@@ -1608,14 +1620,7 @@  void i915_driver_remove(struct drm_i915_private *i915)
 
 	intel_gvt_driver_remove(i915);
 
-	intel_modeset_driver_remove(&i915->drm);
-
-	intel_bios_driver_remove(i915);
-
-	vga_switcheroo_unregister_client(pdev);
-	vga_client_register(pdev, NULL, NULL, NULL);
-
-	intel_csr_ucode_fini(i915);
+	i915_driver_modeset_remove(i915);
 
 	/* Free error state after interrupts are fully disabled. */
 	cancel_delayed_work_sync(&i915->gt.hangcheck.work);

Comments

On Fri, 20 Sep 2019, Jani Nikula <jani.nikula@intel.com> wrote:
> For completeness, add counterpart to i915_driver_modeset_probe() and
> remove the asymmetry in the probe/remove parts. No functional changes.
>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Pushed the series, thanks for the review. Now to figure out how to tame
the actual dragon, this was just warmup...

BR,
Jani.


> ---
>  drivers/gpu/drm/i915/i915_drv.c | 25 +++++++++++++++----------
>  1 file changed, 15 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 9904f762f4bb..4cb95fd9b35d 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -422,6 +422,20 @@ static int i915_driver_modeset_probe(struct drm_device *dev)
>  	return ret;
>  }
>  
> +static void i915_driver_modeset_remove(struct drm_i915_private *i915)
> +{
> +	struct pci_dev *pdev = i915->drm.pdev;
> +
> +	intel_modeset_driver_remove(&i915->drm);
> +
> +	intel_bios_driver_remove(i915);
> +
> +	vga_switcheroo_unregister_client(pdev);
> +	vga_client_register(pdev, NULL, NULL, NULL);
> +
> +	intel_csr_ucode_fini(i915);
> +}
> +
>  static void intel_init_dpio(struct drm_i915_private *dev_priv)
>  {
>  	/*
> @@ -1586,8 +1600,6 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  
>  void i915_driver_remove(struct drm_i915_private *i915)
>  {
> -	struct pci_dev *pdev = i915->drm.pdev;
> -
>  	disable_rpm_wakeref_asserts(&i915->runtime_pm);
>  
>  	i915_driver_unregister(i915);
> @@ -1608,14 +1620,7 @@ void i915_driver_remove(struct drm_i915_private *i915)
>  
>  	intel_gvt_driver_remove(i915);
>  
> -	intel_modeset_driver_remove(&i915->drm);
> -
> -	intel_bios_driver_remove(i915);
> -
> -	vga_switcheroo_unregister_client(pdev);
> -	vga_client_register(pdev, NULL, NULL, NULL);
> -
> -	intel_csr_ucode_fini(i915);
> +	i915_driver_modeset_remove(i915);
>  
>  	/* Free error state after interrupts are fully disabled. */
>  	cancel_delayed_work_sync(&i915->gt.hangcheck.work);