From patchwork Thu May 19 09:51:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 12854723 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 484E7C433EF for ; Thu, 19 May 2022 09:52:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9969E11B2F8; Thu, 19 May 2022 09:52:05 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by gabe.freedesktop.org (Postfix) with ESMTPS id A66E011B2F7 for ; Thu, 19 May 2022 09:52:04 +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 C774B80FC8; Thu, 19 May 2022 11:52:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1652953922; bh=c8RTLF10V/NeLttTYW5MuXusbIaJnYY2r30V12DtxJQ=; h=From:To:Cc:Subject:Date:From; b=VXc3cRBkUq1PsZ34oVU1qSWDIOniHFUZ23OA9/jiWBaHxnFWo4HSSPq9qL75wsp7A xSToukxXQdEGm35SLYsJZ8R4KcADF7IS5rzyoU1I7VgiVFQWE0TfxyzJBzHTgWNZPQ dvHiY1ev0uQdBZkAdwLbCsKafwOF+U7PSbfTACHD2iykJIMMrgP4kvgl1qium36cBB 86njhFfekGFWldLzp4rFcqsCfFtyppTxlMFpI+8Kz/eIuuXhzkkg6N133SYdIVXyN6 tYLXZPLV71vrK/W+HRv/S4GF/HvC20eiU1rPijbUthuJuXA9tT+DaRLFQ32BdVB+aN gaPpXAxwUST+g== From: Marek Vasut To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 1/2] drm/bridge: tc358767: Handle dsi_lanes == 0 as invalid Date: Thu, 19 May 2022 11:51:36 +0200 Message-Id: <20220519095137.11896-1-marex@denx.de> X-Mailer: git-send-email 2.35.1 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 , Maxime Ripard , Jonas Karlman , Neil Armstrong , robert.foss@linaro.org, Laurent Pinchart , Andrzej Hajda , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Handle empty data-lanes = < >; property, which translates to dsi_lanes = 0 as invalid. Reviewed-by: Andrzej Hajda Reviewed-by: Lucas Stach Fixes: bbfd3190b6562 ("drm/bridge: tc358767: Add DSI-to-DPI mode support") Signed-off-by: Marek Vasut Cc: Jonas Karlman Cc: Laurent Pinchart Cc: Lucas Stach Cc: Marek Vasut Cc: Maxime Ripard Cc: Neil Armstrong Cc: Robert Foss Cc: Sam Ravnborg --- V2: - Add RB from Andrzej and Lucas --- drivers/gpu/drm/bridge/tc358767.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 798da0e4d0863..f78c2ad845159 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1899,7 +1899,7 @@ static int tc_mipi_dsi_host_attach(struct tc_data *tc) of_node_put(host_node); of_node_put(endpoint); - if (dsi_lanes < 0 || dsi_lanes > 4) + if (dsi_lanes <= 0 || dsi_lanes > 4) return -EINVAL; if (!host)