}
EXPORT_SYMBOL(drm_add_override_edid_modes);
+typedef int read_block_fn(void *context, u8 *buf, unsigned int block, size_t len);
+
static struct edid *drm_do_get_edid_base_block(struct drm_connector *connector,
- int (*get_edid_block)(void *data, u8 *buf, unsigned int block,
- size_t len),
- void *data)
+ read_block_fn read_block,
+ void *context)
{
int *null_edid_counter = connector ? &connector->null_edid_counter : NULL;
bool *edid_corrupt = connector ? &connector->edid_corrupt : NULL;
/* base block fetch */
for (try = 0; try < 4; try++) {
- if (get_edid_block(data, edid, 0, EDID_LENGTH))
+ if (read_block(context, edid, 0, EDID_LENGTH))
goto out;
if (drm_edid_block_valid(edid, 0, false, edid_corrupt))
break;
* Return: Pointer to valid EDID or NULL if we couldn't find any.
*/
struct edid *drm_do_get_edid(struct drm_connector *connector,
- int (*get_edid_block)(void *data, u8 *buf, unsigned int block,
- size_t len),
- void *data)
+ read_block_fn read_block,
+ void *context)
{
int j, invalid_blocks = 0;
struct edid *edid, *new, *override;
if (override)
return override;
- edid = drm_do_get_edid_base_block(connector, get_edid_block, data);
+ edid = drm_do_get_edid_base_block(connector, read_block, context);
if (!edid)
return NULL;
int try;
for (try = 0; try < 4; try++) {
- if (get_edid_block(data, block, j, EDID_LENGTH))
+ if (read_block(context, block, j, EDID_LENGTH))
goto out;
if (drm_edid_block_valid(block, j, false, NULL))
break;