return num_modes;
}
-/**
- * drm_add_edid_modes - add modes from EDID data, if available
- * @connector: connector we're probing
- * @edid: EDID data
- *
- * Add the specified modes to the connector's mode list. Also fills out the
- * &drm_display_info structure and ELD in @connector with any information which
- * can be derived from the edid.
- *
- * Return: The number of modes added or 0 if we couldn't find any.
- */
-int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
+static int drm_edid_connector_update(struct drm_connector *connector,
+ const struct edid *edid)
{
int num_modes = 0;
u32 quirks;
clear_eld(connector);
return 0;
}
- if (!drm_edid_is_valid(edid)) {
- clear_eld(connector);
- drm_warn(connector->dev, "%s: EDID invalid.\n",
- connector->name);
- return 0;
- }
drm_edid_to_eld(connector, edid);
return num_modes;
}
+
+/**
+ * drm_add_edid_modes - add modes from EDID data, if available
+ * @connector: connector we're probing
+ * @edid: EDID data
+ *
+ * Add the specified modes to the connector's mode list. Also fills out the
+ * &drm_display_info structure and ELD in @connector with any information which
+ * can be derived from the edid.
+ *
+ * Return: The number of modes added or 0 if we couldn't find any.
+ */
+int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
+{
+ if (edid && !drm_edid_is_valid(edid)) {
+ drm_warn(connector->dev, "%s: EDID invalid.\n",
+ connector->name);
+ edid = NULL;
+ }
+
+ return drm_edid_connector_update(connector, edid);
+}
EXPORT_SYMBOL(drm_add_edid_modes);
/**