From: Guido Martínez Date: Tue, 17 Jun 2014 14:17:03 +0000 (-0300) Subject: drm/i2c: tda998x: move drm_i2c_encoder_destroy call X-Git-Tag: v4.9.8~5935^2~17^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2e48cecb55435e10c93c6aface1a1c7ef32f4e71;p=platform%2Fkernel%2Flinux-rpi3.git drm/i2c: tda998x: move drm_i2c_encoder_destroy call Currently tda998x_encoder_destroy() calls cec_write() and reg_clear(), as part of the release procedure. Such calls need to access the I2C bus and therefore, we need to call them before drm_i2c_encoder_destroy() which unregisters the I2C device. This commit moves the latter so it's done afterwards. Signed-off-by: Guido Martínez Signed-off-by: Ezequiel García Cc: #v3.9+ Signed-off-by: Russell King --- diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c index 48af5ca..b98c969 100644 --- a/drivers/gpu/drm/i2c/tda998x_drv.c +++ b/drivers/gpu/drm/i2c/tda998x_drv.c @@ -1183,7 +1183,6 @@ static void tda998x_encoder_destroy(struct drm_encoder *encoder) { struct tda998x_priv *priv = to_tda998x_priv(encoder); - drm_i2c_encoder_destroy(encoder); /* disable all IRQs and free the IRQ handler */ cec_write(priv, REG_CEC_RXSHPDINTENA, 0); @@ -1193,6 +1192,7 @@ tda998x_encoder_destroy(struct drm_encoder *encoder) if (priv->cec) i2c_unregister_device(priv->cec); + drm_i2c_encoder_destroy(encoder); kfree(priv); }