[Intel-gfx] [PATCH] drm/i915: fix dp/sdvo i2c cleanup

Chris Wilson chris at chris-wilson.co.uk
Fri Jan 24 10:29:39 CET 2014


On Fri, Jan 24, 2014 at 11:15:55AM +0200, Imre Deak wrote:
> Atm we try to remove the connector's i2c sysfs entry too late in the
> encoder's destroy callback. By that time the kobject used as the parent
> for all connector sysfs entries is already removed when we do an early
> removal of all connector sysfs entries in intel_modeset_cleanup(). Fix
> this by adding an early_destory encoder callback, where we remove the
                         ^destroy
> encoder's i2c adapter.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70523
> 
> Signed-off-by: Imre Deak <imre.deak at intel.com>
> ---

> +void intel_dp_encoder_early_destroy(struct intel_encoder *intel_encoder)
static void intel_dp_encoder_early_destroy(struct intel_encoder *intel_encoder)

> +{
> +	struct intel_dp *intel_dp = enc_to_intel_dp(&intel_encoder->base);
> +
> +	i2c_del_adapter(&intel_dp->adapter);

Sigh. ->adapter is too generic, as there are quite a few things
associated with the link that may be called adapter.

> +}
> +
>  static const struct drm_connector_funcs intel_dp_connector_funcs = {
>  	.dpms = intel_connector_dpms,
>  	.detect = intel_dp_detect,
> @@ -3880,6 +3887,7 @@ intel_dp_init(struct drm_device *dev, int output_reg, enum port port)
>  		intel_encoder->pre_enable = g4x_pre_enable_dp;
>  		intel_encoder->enable = g4x_enable_dp;
>  	}

> +static void intel_sdvo_early_destroy(struct intel_encoder *intel_encoder)
> +{
> +	struct intel_sdvo *intel_sdvo;
> +
> +	intel_sdvo = container_of(intel_encoder, struct intel_sdvo, base);

struct intel_sdvo *intel_sdvo = to_sdvo(intel_encoder);

> +	i2c_del_adapter(&intel_sdvo->ddc);
> +}

The intel_prefix is redundant in these cases as there is no confusion
with a generic drm_sdvo or drm_dp.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list