Commit d0f1fd3a authored by Jani Nikula's avatar Jani Nikula

drm/bridge: nxp-ptn3460: switch to ->edid_read callback

Prefer using the struct drm_edid based callback and functions.

v2: Fix -Wsometimes-uninitialized (kernel test robot)
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/6f4e48af3bf4d7782e8dfad703b6f22a69e94bf8.1706038510.git.jani.nikula@intel.com
parent e3cbc95f
...@@ -154,10 +154,11 @@ static void ptn3460_disable(struct drm_bridge *bridge) ...@@ -154,10 +154,11 @@ static void ptn3460_disable(struct drm_bridge *bridge)
} }
static struct edid *ptn3460_get_edid(struct drm_bridge *bridge, static const struct drm_edid *ptn3460_edid_read(struct drm_bridge *bridge,
struct drm_connector *connector) struct drm_connector *connector)
{ {
struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge); struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge);
const struct drm_edid *drm_edid = NULL;
bool power_off; bool power_off;
u8 *edid; u8 *edid;
int ret; int ret;
...@@ -175,27 +176,28 @@ static struct edid *ptn3460_get_edid(struct drm_bridge *bridge, ...@@ -175,27 +176,28 @@ static struct edid *ptn3460_get_edid(struct drm_bridge *bridge,
EDID_LENGTH); EDID_LENGTH);
if (ret) { if (ret) {
kfree(edid); kfree(edid);
edid = NULL;
goto out; goto out;
} }
drm_edid = drm_edid_alloc(edid, EDID_LENGTH);
out: out:
if (power_off) if (power_off)
ptn3460_disable(&ptn_bridge->bridge); ptn3460_disable(&ptn_bridge->bridge);
return (struct edid *)edid; return drm_edid;
} }
static int ptn3460_connector_get_modes(struct drm_connector *connector) static int ptn3460_connector_get_modes(struct drm_connector *connector)
{ {
struct ptn3460_bridge *ptn_bridge = connector_to_ptn3460(connector); struct ptn3460_bridge *ptn_bridge = connector_to_ptn3460(connector);
struct edid *edid; const struct drm_edid *drm_edid;
int num_modes; int num_modes;
edid = ptn3460_get_edid(&ptn_bridge->bridge, connector); drm_edid = ptn3460_edid_read(&ptn_bridge->bridge, connector);
drm_connector_update_edid_property(connector, edid); drm_edid_connector_update(connector, drm_edid);
num_modes = drm_add_edid_modes(connector, edid); num_modes = drm_edid_connector_add_modes(connector);
kfree(edid); drm_edid_free(drm_edid);
return num_modes; return num_modes;
} }
...@@ -254,7 +256,7 @@ static const struct drm_bridge_funcs ptn3460_bridge_funcs = { ...@@ -254,7 +256,7 @@ static const struct drm_bridge_funcs ptn3460_bridge_funcs = {
.pre_enable = ptn3460_pre_enable, .pre_enable = ptn3460_pre_enable,
.disable = ptn3460_disable, .disable = ptn3460_disable,
.attach = ptn3460_bridge_attach, .attach = ptn3460_bridge_attach,
.get_edid = ptn3460_get_edid, .edid_read = ptn3460_edid_read,
}; };
static int ptn3460_probe(struct i2c_client *client) static int ptn3460_probe(struct i2c_client *client)
......
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