drm/msm: Convert to drm_of_get_data_lanes_count

Convert driver to use this new helper to standardize
OF "data-lanes" parsing.

Reviewed-by: Andrzej Hajda <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Cc: Abhinav Kumar <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Lucas Stach <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Rob Clark <[email protected]>
Cc: Robert Foss <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Sean Paul <[email protected]>
To: [email protected]
Reviewed-by: Abhinav Kumar <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
This commit is contained in:
Marek Vasut
2022-06-12 12:22:26 +02:00
parent 254a8d0c00
commit 185443efa2
2 changed files with 5 additions and 8 deletions
+2 -4
View File
@@ -102,11 +102,9 @@ static int dp_parser_ctrl_res(struct dp_parser *parser)
static int dp_parser_misc(struct dp_parser *parser)
{
struct device_node *of_node = parser->pdev->dev.of_node;
int len = 0;
const char *data_lane_property = "data-lanes";
int len;
len = of_property_count_elems_of_size(of_node,
data_lane_property, sizeof(u32));
len = drm_of_get_data_lanes_count(of_node, 1, DP_MAX_NUM_DP_LANES);
if (len < 0) {
DRM_WARN("Invalid property %s, default max DP lanes = %d\n",
data_lane_property, DP_MAX_NUM_DP_LANES);
+3 -4
View File
@@ -1673,11 +1673,10 @@ static int dsi_host_parse_lane_data(struct msm_dsi_host *msm_host,
return 0;
}
num_lanes = len / sizeof(u32);
if (num_lanes < 1 || num_lanes > 4) {
num_lanes = drm_of_get_data_lanes_count(ep, 1, 4);
if (num_lanes < 0) {
DRM_DEV_ERROR(dev, "bad number of data lanes\n");
return -EINVAL;
return num_lanes;
}
msm_host->num_data_lanes = num_lanes;