]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/i915: Make gmbus setup take dev_priv
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Thu, 1 Dec 2016 14:16:42 +0000 (14:16 +0000)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Thu, 1 Dec 2016 18:01:22 +0000 (18:01 +0000)
Simplify the code by passing the right argument in.

v2: Commit message. (Joonas Lahtinen)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_i2c.c

index 362c8baef640e7382d73acd9b6ce3490adc100aa..fee0b46a04bc478223e584b8f6db9dac8ab1f7af 100644 (file)
@@ -592,7 +592,7 @@ static int i915_load_modeset_init(struct drm_device *dev)
        if (ret)
                goto cleanup_csr;
 
-       intel_setup_gmbus(dev);
+       intel_setup_gmbus(dev_priv);
 
        /* Important: The output setup functions called by modeset_init need
         * working irqs for e.g. gmbus and dp aux transfers. */
@@ -629,7 +629,7 @@ cleanup_gem:
 cleanup_irq:
        intel_guc_fini(dev_priv);
        drm_irq_uninstall(dev);
-       intel_teardown_gmbus(dev);
+       intel_teardown_gmbus(dev_priv);
 cleanup_csr:
        intel_csr_ucode_fini(dev_priv);
        intel_power_domains_fini(dev_priv);
index 6cb4bb349c89c1a5b0a306b66da08eade3f79e2c..44aecad47b21d17d0c7f54c6f0e292ba33fe2a6e 100644 (file)
@@ -3478,8 +3478,8 @@ void i915_setup_sysfs(struct drm_i915_private *dev_priv);
 void i915_teardown_sysfs(struct drm_i915_private *dev_priv);
 
 /* intel_i2c.c */
-extern int intel_setup_gmbus(struct drm_device *dev);
-extern void intel_teardown_gmbus(struct drm_device *dev);
+extern int intel_setup_gmbus(struct drm_i915_private *dev_priv);
+extern void intel_teardown_gmbus(struct drm_i915_private *dev_priv);
 extern bool intel_gmbus_is_valid_pin(struct drm_i915_private *dev_priv,
                                     unsigned int pin);
 
index b91e0abf66bacb6da89630720a93d953172991a4..e5573a3ca704265761405b49b902b14af192f0f4 100644 (file)
@@ -17162,7 +17162,7 @@ void intel_modeset_cleanup(struct drm_device *dev)
 
        intel_cleanup_gt_powersave(dev_priv);
 
-       intel_teardown_gmbus(dev);
+       intel_teardown_gmbus(dev_priv);
 }
 
 void intel_connector_attach_encoder(struct intel_connector *connector,
index 83f260bb4eefe59156adedd663901ba2d14d73cc..85faba415633ed5de49d1318f25e370006259ccf 100644 (file)
@@ -617,11 +617,10 @@ static const struct i2c_algorithm gmbus_algorithm = {
 
 /**
  * intel_gmbus_setup - instantiate all Intel i2c GMBuses
- * @dev: DRM device
+ * @dev_priv: i915 device private
  */
-int intel_setup_gmbus(struct drm_device *dev)
+int intel_setup_gmbus(struct drm_i915_private *dev_priv)
 {
-       struct drm_i915_private *dev_priv = to_i915(dev);
        struct pci_dev *pdev = dev_priv->drm.pdev;
        struct intel_gmbus *bus;
        unsigned int pin;
@@ -724,9 +723,8 @@ void intel_gmbus_force_bit(struct i2c_adapter *adapter, bool force_bit)
        mutex_unlock(&dev_priv->gmbus_mutex);
 }
 
-void intel_teardown_gmbus(struct drm_device *dev)
+void intel_teardown_gmbus(struct drm_i915_private *dev_priv)
 {
-       struct drm_i915_private *dev_priv = to_i915(dev);
        struct intel_gmbus *bus;
        unsigned int pin;