Commit 939857d6 authored by Jani Nikula's avatar Jani Nikula

drm/bridge: anx7625: switch to ->edid_read callback

Prefer using the struct drm_edid based callback.

v2: Fix build (goto out;)
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/62b905f4ec9fe3efa3785d34006b7e45e4c6c88b.1706038510.git.jani.nikula@intel.com
parent 3ce73840
...@@ -1784,24 +1784,14 @@ static ssize_t anx7625_aux_transfer(struct drm_dp_aux *aux, ...@@ -1784,24 +1784,14 @@ static ssize_t anx7625_aux_transfer(struct drm_dp_aux *aux,
return ret; return ret;
} }
static struct edid *anx7625_get_edid(struct anx7625_data *ctx) static const struct drm_edid *anx7625_edid_read(struct anx7625_data *ctx)
{ {
struct device *dev = ctx->dev; struct device *dev = ctx->dev;
struct s_edid_data *p_edid = &ctx->slimport_edid_p; struct s_edid_data *p_edid = &ctx->slimport_edid_p;
int edid_num; int edid_num;
u8 *edid;
edid = kmalloc(FOUR_BLOCK_SIZE, GFP_KERNEL); if (ctx->slimport_edid_p.edid_block_num > 0)
if (!edid) { goto out;
DRM_DEV_ERROR(dev, "Fail to allocate buffer\n");
return NULL;
}
if (ctx->slimport_edid_p.edid_block_num > 0) {
memcpy(edid, ctx->slimport_edid_p.edid_raw_data,
FOUR_BLOCK_SIZE);
return (struct edid *)edid;
}
pm_runtime_get_sync(dev); pm_runtime_get_sync(dev);
_anx7625_hpd_polling(ctx, 5000 * 100); _anx7625_hpd_polling(ctx, 5000 * 100);
...@@ -1810,14 +1800,14 @@ static struct edid *anx7625_get_edid(struct anx7625_data *ctx) ...@@ -1810,14 +1800,14 @@ static struct edid *anx7625_get_edid(struct anx7625_data *ctx)
if (edid_num < 1) { if (edid_num < 1) {
DRM_DEV_ERROR(dev, "Fail to read EDID: %d\n", edid_num); DRM_DEV_ERROR(dev, "Fail to read EDID: %d\n", edid_num);
kfree(edid);
return NULL; return NULL;
} }
p_edid->edid_block_num = edid_num; p_edid->edid_block_num = edid_num;
memcpy(edid, ctx->slimport_edid_p.edid_raw_data, FOUR_BLOCK_SIZE); out:
return (struct edid *)edid; return drm_edid_alloc(ctx->slimport_edid_p.edid_raw_data,
FOUR_BLOCK_SIZE);
} }
static enum drm_connector_status anx7625_sink_detect(struct anx7625_data *ctx) static enum drm_connector_status anx7625_sink_detect(struct anx7625_data *ctx)
...@@ -2492,15 +2482,15 @@ anx7625_bridge_detect(struct drm_bridge *bridge) ...@@ -2492,15 +2482,15 @@ anx7625_bridge_detect(struct drm_bridge *bridge)
return anx7625_sink_detect(ctx); return anx7625_sink_detect(ctx);
} }
static struct edid *anx7625_bridge_get_edid(struct drm_bridge *bridge, static const struct drm_edid *anx7625_bridge_edid_read(struct drm_bridge *bridge,
struct drm_connector *connector) struct drm_connector *connector)
{ {
struct anx7625_data *ctx = bridge_to_anx7625(bridge); struct anx7625_data *ctx = bridge_to_anx7625(bridge);
struct device *dev = ctx->dev; struct device *dev = ctx->dev;
DRM_DEV_DEBUG_DRIVER(dev, "drm bridge get edid\n"); DRM_DEV_DEBUG_DRIVER(dev, "drm bridge get edid\n");
return anx7625_get_edid(ctx); return anx7625_edid_read(ctx);
} }
static const struct drm_bridge_funcs anx7625_bridge_funcs = { static const struct drm_bridge_funcs anx7625_bridge_funcs = {
...@@ -2515,7 +2505,7 @@ static const struct drm_bridge_funcs anx7625_bridge_funcs = { ...@@ -2515,7 +2505,7 @@ static const struct drm_bridge_funcs anx7625_bridge_funcs = {
.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
.atomic_reset = drm_atomic_helper_bridge_reset, .atomic_reset = drm_atomic_helper_bridge_reset,
.detect = anx7625_bridge_detect, .detect = anx7625_bridge_detect,
.get_edid = anx7625_bridge_get_edid, .edid_read = anx7625_bridge_edid_read,
}; };
static int anx7625_register_i2c_dummy_clients(struct anx7625_data *ctx, static int anx7625_register_i2c_dummy_clients(struct anx7625_data *ctx,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment