Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3030836rwb; Mon, 15 Aug 2022 16:30:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR4YZt1cW98OIEEaNhpalAC2lvt4OFRfdSdRU9Fjbz8rRaTzQCP2Qvf3ijBZr4eDIGtw8G57 X-Received: by 2002:a17:906:c154:b0:733:197:a8c with SMTP id dp20-20020a170906c15400b0073301970a8cmr11956673ejc.483.1660606203823; Mon, 15 Aug 2022 16:30:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660606203; cv=none; d=google.com; s=arc-20160816; b=EqV/ozwOgXJNkSrpfJ9WsziJtqONH1NoXIKIKj1bMGf1PG7qwbMmPSRcD2Uq2LdBPm lUvtth0tlVx+YhW4TZLNEYeVR16Bad2P0crCo0ohTa6+v9PR+2x/CEyDuky5ap0nP+dF KosaCMj+rlkCoyMKv2+HcMBzpK+B5r6PiDIET2n52CXheyaoLMFGBJEIWqrC2rh/GuJu I3wO85/XOADnI25t0EnypgXpDh35t/91g0OVbpPFc158YWAO79+mvZe8h0lVT2Z1HLm7 +ldsGGIOZb20A29VN4d4lQb3OVBQ6n0BE4oBanvNUVf0xthmSLRfJK2A0U1o03IwQ3w0 WFcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ne7bmW0g+CvsS8ivHkat1dVxLOjP40cVPpZ2Hdrf10Q=; b=dlXKimNIHIzN1PAG7E/yunWATNFxRLVKE5l8hg/R71A7yaicMLs0bePafJD0Y/SFRZ pr7xWz1cfl6dnpeu23Pv0qzTA6MJQh1lD5278kwtNI+g3nQrR15Vz8eWrZUIQoYbqlu0 M3znMXoM7FONh3ETYBELobeDz6FHZdpXNDWllJg137WaEJ3Zkm/jvrvh4Wx3p24qUqTV ojHjYMRl3+Oebg70Rt6Ut5SKXCztBrPR6uv18eONGPwFfB2HHRyUqGu2+Cr0P8TVjvz3 BQ9wWgZQwi8FZDc5L7gNQZtN5nL2bhEjRgC8+b7QX4MY05Jz5VEBADJkp4REqGFkfwVq ra+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WkV4qifh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fj3-20020a1709069c8300b00730c3a98892si10583515ejc.978.2022.08.15.16.29.22; Mon, 15 Aug 2022 16:30:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WkV4qifh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347216AbiHOXVm (ORCPT + 99 others); Mon, 15 Aug 2022 19:21:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241876AbiHOXO3 (ORCPT ); Mon, 15 Aug 2022 19:14:29 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D10DA474FB; Mon, 15 Aug 2022 13:01:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 09617CE12E7; Mon, 15 Aug 2022 20:01:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3C7CC433C1; Mon, 15 Aug 2022 20:01:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593707; bh=nDbHqfhdNpzYZKdbkZ4LGk/SQWMKL/OIcQRYU9Jk20o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WkV4qifhuorlxeXj/qCJ2R6gL9rZ2C0bWOL0FZq7e90/IFeJ5ZqsFk9EFxS3EjA73 K12n8SksGVd3mnMmZSnbWMpWu/ez8C6KsSFNJ0U8tvZr0+o7siAS3fYeirOBWqRioQ 7OgGJ0S+LxOOoeMy0KaWJ1u0I0JPaPXaZTPuHmVk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrzej Hajda , Lucas Stach , Marek Vasut , Jonas Karlman , Laurent Pinchart , Maxime Ripard , Neil Armstrong , Robert Foss , Sam Ravnborg , Sasha Levin Subject: [PATCH 5.19 0313/1157] drm/bridge: tc358767: Handle dsi_lanes == 0 as invalid Date: Mon, 15 Aug 2022 19:54:29 +0200 Message-Id: <20220815180452.170706172@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marek Vasut [ Upstream commit 0d662350928e6787d29ab205e47e5aa6f1f792f9 ] 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 Link: https://patchwork.freedesktop.org/patch/msgid/20220519095137.11896-1-marex@denx.de Signed-off-by: Sasha Levin --- 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 485717c8f0b4..466b8fc9836a 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1871,7 +1871,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) -- 2.35.1