From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6168C54FB9 for ; Thu, 16 Nov 2023 10:29:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230352AbjKPK34 (ORCPT ); Thu, 16 Nov 2023 05:29:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229749AbjKPK3x (ORCPT ); Thu, 16 Nov 2023 05:29:53 -0500 Received: from out-182.mta1.migadu.com (out-182.mta1.migadu.com [95.215.58.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DA97B7 for ; Thu, 16 Nov 2023 02:29:49 -0800 (PST) Message-ID: <50006160-f82b-4ec1-91a4-2ebbd7752e1d@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1700130588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M9Tiz4ZqcvP9PVbA0QUZ7/XAmQaSaESa8alpLYKuTXs=; b=gN0djCjFpM84zH6NfgBbkC3hSOihpNiLmCzdaRDiimhppbOM/E9yIbtA4YpVMSGcYtmbly Sf2YUGzE1sQelfoBBm9AcQBrB1WuHRsVdO8fG23ata6R0a82V5wlzuqapNRre7wvd1v0kr uD/cxYL9mvGHwIQ5KRfKPVqFEu7s+50= Date: Thu, 16 Nov 2023 18:29:39 +0800 MIME-Version: 1.0 Subject: Re: [PATCH 8/8] drm/bridge: it66121: Allow link this driver as a lib Content-Language: en-US To: Dmitry Baryshkov Cc: Phong LE , Neil Armstrong , Maxime Ripard , Sui Jingfeng , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Laurent Pinchart , Thomas Zimmermann References: <20231114150130.497915-1-sui.jingfeng@linux.dev> <20231114150130.497915-9-sui.jingfeng@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Sui Jingfeng In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 2023/11/15 00:30, Dmitry Baryshkov wrote: >> @@ -703,14 +704,32 @@ static int it66121_bridge_attach(struct drm_bridge *bridge, >> enum drm_bridge_attach_flags flags) >> { >> struct it66121_ctx *ctx = bridge_to_it66121(bridge); >> + struct drm_bridge *next_bridge = ctx->next_bridge; >> + struct drm_encoder *encoder = bridge->encoder; >> int ret; >> >> - if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) >> - return -EINVAL; >> + if (next_bridge) { >> + if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) { >> + WARN_ON(1); > Why? At least use WARN() instead If (next_bridge) is true, it says that the driver *already* known that it66121 have a next bridges attached. Then it66121 driver should certainly attach it, no matter what it is. Either a connector or another display bridge. It also says that this is a DT-based system on such a case. CallingWARN_ON(1) here helps to see(print) which DC driver is doing the wired things. Ok, I will remove the WARN_ON(1) on the next version.