Message ID | b8c477279a6ae1b44df72bee230180e277087fae.1715691257.git.jani.nikula@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm: conversions to struct drm_edid | expand |
Hi, Jani I love your patch, thanks. On 2024/5/14 20:55, Jani Nikula wrote: > Prefer the struct drm_edid based functions for reading the EDID and > updating the connector. > > Signed-off-by: Jani Nikula <jani.nikula@intel.com> > --- Reviewed-by: Sui Jingfeng <sui.jingfeng@linux.dev>
diff --git a/drivers/gpu/drm/loongson/lsdc_output_7a2000.c b/drivers/gpu/drm/loongson/lsdc_output_7a2000.c index ce3dabec887e..2bd797a9b9ff 100644 --- a/drivers/gpu/drm/loongson/lsdc_output_7a2000.c +++ b/drivers/gpu/drm/loongson/lsdc_output_7a2000.c @@ -44,16 +44,15 @@ static int ls7a2000_connector_get_modes(struct drm_connector *connector) { - unsigned int num = 0; - struct edid *edid; + int num; if (connector->ddc) { - edid = drm_get_edid(connector, connector->ddc); - if (edid) { - drm_connector_update_edid_property(connector, edid); - num = drm_add_edid_modes(connector, edid); - kfree(edid); - } + const struct drm_edid *drm_edid; + + drm_edid = drm_edid_read(connector); + drm_edid_connector_update(connector, drm_edid); + num = drm_edid_connector_add_modes(connector); + drm_edid_free(drm_edid); return num; }
Prefer the struct drm_edid based functions for reading the EDID and updating the connector. Signed-off-by: Jani Nikula <jani.nikula@intel.com> --- Cc: Sui Jingfeng <suijingfeng@loongson.cn> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <mripard@kernel.org> Cc: Thomas Zimmermann <tzimmermann@suse.de> --- drivers/gpu/drm/loongson/lsdc_output_7a2000.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)