From patchwork Tue May 24 01:05:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 12859603 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 94B91C433EF for ; Tue, 24 May 2022 01:05:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1B9FC10E962; Tue, 24 May 2022 01:05:50 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6849310E8C3 for ; Tue, 24 May 2022 01:05:48 +0000 (UTC) Received: from tr.lan (ip-86-49-12-201.net.upcbroadband.cz [86.49.12.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 2D07580107; Tue, 24 May 2022 03:05:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1653354346; bh=BpRkOrlk0nBpcSihYLNUWpEopLsBmcJZN3zwWUsMBVs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gz3S86snpKqcMrdrPdLgdfFKx25I8b7rC3R0l69e6P5lAWElkDEh9MC1SU2cgjiUO qFtm8x672LOvyPaUZNxFrVt8WpJM7eWf8AHUJLfFmZTvWuw6knyqX8r5JmUXa91qmR 7RWN77fl7hILzRxDHUVPRJqObNqdVgSAq1g/fgE2t3a40b7HWIdULNY8bk+2FuipWf lMUz/1AlhdbsBjp0q+kpZ769Nb3HKLM72CX/9IK0fvuOIvv/6akayQ1sSDAsbvrKky +bD727mC1LU0ZwXQ/jvqiGdWtlE+QO51zwiIrz7vQfpgG9Oz4GT9mgkytk87kgyWZ0 1HL0fy/wPi3MA== From: Marek Vasut To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 02/11] drm/bridge: anx7625: Convert to drm_of_get_data_lanes_count Date: Tue, 24 May 2022 03:05:13 +0200 Message-Id: <20220524010522.528569-2-marex@denx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220524010522.528569-1-marex@denx.de> References: <20220524010522.528569-1-marex@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Laurent Pinchart , robert.foss@linaro.org, Maxime Ripard , Andrzej Hajda , Sam Ravnborg , Xin Ji Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Convert driver to use this new helper to standardize OF "data-lanes" parsing. Reviewed-by: Andrzej Hajda Signed-off-by: Marek Vasut Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Lucas Stach Cc: Maxime Ripard Cc: Robert Foss Cc: Sam Ravnborg Cc: Xin Ji To: dri-devel@lists.freedesktop.org --- V2: - Rename drm_of_get_data_lanes{,_ep} to drm_of_get_data_lanes_count{,_ep} - Add RB from Andrzej --- drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index e92eb4a407452..bbdca16db0d67 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -1637,16 +1637,16 @@ static int anx7625_parse_dt(struct device *dev, if (of_property_read_u32(ep0, "bus-type", &bus_type)) bus_type = 0; - mipi_lanes = of_property_count_u32_elems(ep0, "data-lanes"); + mipi_lanes = drm_of_get_data_lanes_count(ep0, 1, MAX_LANES_SUPPORT); of_node_put(ep0); } if (bus_type == V4L2_FWNODE_BUS_TYPE_PARALLEL) /* bus type is Parallel(DSI) */ pdata->is_dpi = 0; - pdata->mipi_lanes = mipi_lanes; - if (pdata->mipi_lanes > MAX_LANES_SUPPORT || pdata->mipi_lanes <= 0) - pdata->mipi_lanes = MAX_LANES_SUPPORT; + pdata->mipi_lanes = MAX_LANES_SUPPORT; + if (mipi_lanes > 0) + pdata->mipi_lanes = mipi_lanes; if (pdata->is_dpi) DRM_DEV_DEBUG_DRIVER(dev, "found MIPI DPI host node.\n");