drm/i2c/ch7006: Don't assume that the specified config points to static memory.
authorFrancisco Jerez <currojerez@riseup.net>
Mon, 19 Jul 2010 13:28:41 +0000 (15:28 +0200)
committerBen Skeggs <bskeggs@redhat.com>
Mon, 26 Jul 2010 01:42:25 +0000 (11:42 +1000)
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/i2c/ch7006_drv.c
drivers/gpu/drm/i2c/ch7006_priv.h

index 3e2c9da6c81eeb9ba0d8dec1067bcb1af547f1af..833b35f44a7705a336d432940c393016de7cd77d 100644 (file)
@@ -33,7 +33,7 @@ static void ch7006_encoder_set_config(struct drm_encoder *encoder,
 {
        struct ch7006_priv *priv = to_ch7006_priv(encoder);
 
-       priv->params = params;
+       priv->params = *(struct ch7006_encoder_params *)params;
 }
 
 static void ch7006_encoder_destroy(struct drm_encoder *encoder)
@@ -114,7 +114,7 @@ static void ch7006_encoder_mode_set(struct drm_encoder *encoder,
 {
        struct i2c_client *client = drm_i2c_encoder_get_client(encoder);
        struct ch7006_priv *priv = to_ch7006_priv(encoder);
-       struct ch7006_encoder_params *params = priv->params;
+       struct ch7006_encoder_params *params = &priv->params;
        struct ch7006_state *state = &priv->state;
        uint8_t *regs = state->regs;
        struct ch7006_mode *mode = priv->mode;
index b06d3d93d8acb3facfb607691a2d61f11409a025..1c6d2e3bd96f154b636f5b15b34766565143ebd1 100644 (file)
@@ -77,7 +77,7 @@ struct ch7006_state {
 };
 
 struct ch7006_priv {
-       struct ch7006_encoder_params *params;
+       struct ch7006_encoder_params params;
        struct ch7006_mode *mode;
 
        struct ch7006_state state;