From: Francisco Jerez Date: Thu, 22 Jul 2010 15:07:38 +0000 (+0200) Subject: drm/kms: Simplify setup of the initial I2C encoder config. X-Git-Tag: firefly_0821_release~9833^2~636^2~62 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a1e09b62592eb57e25f8d076ffa5b7bef18be812;p=firefly-linux-kernel-4.4.55.git drm/kms: Simplify setup of the initial I2C encoder config. In most use cases the driver will be using the same static config all the time: interpreting i2c_board_info::platform_data as the default config we can can save the GPU driver a redundant set_config() call. Signed-off-by: Francisco Jerez Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/drm_encoder_slave.c b/drivers/gpu/drm/drm_encoder_slave.c index f0184696edf3..d62c064fbaa0 100644 --- a/drivers/gpu/drm/drm_encoder_slave.c +++ b/drivers/gpu/drm/drm_encoder_slave.c @@ -41,6 +41,9 @@ * &drm_encoder_slave. The @slave_funcs field will be initialized with * the hooks provided by the slave driver. * + * If @info->platform_data is non-NULL it will be used as the initial + * slave config. + * * Returns 0 on success or a negative errno on failure, in particular, * -ENODEV is returned when no matching driver is found. */ @@ -85,6 +88,10 @@ int drm_i2c_encoder_init(struct drm_device *dev, if (err) goto fail_unregister; + if (info->platform_data) + encoder->slave_funcs->set_config(&encoder->base, + info->platform_data); + return 0; fail_unregister: